English 中文(简体)
如何使用 # # 包括 Glsl 支持 ARB_ 阴影 _ 语言 _ 包括
原标题:How to Using the #include in glsl support ARB_shading_language_include
  • 时间:2012-05-25 12:27:42
  •  标签:
  • opengl
  • glsl

我希望使用 包含 宏, 以在 glsl 中包括阴影文件。 我听说有 ARB_shading_language_ including < a href=> 包含 < a href=" http://www.opengl.org/registry/specs/ARB/shading_language_ including.txt > extension 支持 including 宏。 有没有人能给我一个显示如何使用 包括 宏的代码片?

最佳回答

您需要理解的第一件事是 < a href=> "" "http://www.opengl.org/registry/specres/ARB/shading_langues_including.txt" >shading_language_including 包含 。 它不是“I including a files from the磁盘。 OpenGL不知道文件是什么, 它没有文件系统的概念 。

相反,您必须先装入所有您可能想要包含的文件 。 因此您必须有一个阴影字符串和一个文件名, 您从中装入了字符串。 基本上, 您必须在 OpenGL 内建立一个虚拟文件系统 。

您使用 glNamedStringARB 将字符串上传到虚拟文件系统。 字符串的名称是其完整路径名 。

一旦您建立了虚拟文件系统, 您就必须对您编译的每个阴影进行初始化扩展名 。

#version MY_OPENGL_VERSION //Whatever version you re using.
#extension GL_ARB_shading_language_include : require

extension 语句后,您可以酌情 包括

问题回答

我想回答0xbadf00d的问题,但缺乏声誉。

From ARB/shading_language_include.txt: "<type> must be SHADER_INCLUDE_ARB"

我可能会在您的应用程序的构建中这样做, 并将已经由构建文件预处理的文件输出到由应用程序安装和装入的文件, 并传送到阴影编译器 。





相关问题
OpenGL 3D Selection

I am trying to create a 3D robot that should perform certain actions when certain body parts are clicked. I have successfully (sort of) implemented picking in that if you click on any x-plane part, it ...

CVDisplayLink instead of NSTimer

I have started to implement cvDisplayLink to drive the render loop instead of nstimer, as detailed in this technical note https://developer.apple.com/library/archive/qa/qa1385/_index.html Is it ...

Can the iPhone simulator handle PVR textures?

I have a really weird problem with PVR textures on the iPhone simulator- the framerate falls through the floor on the iPhone simulator, but on the iPhone itself it works just fine. Has anyone had any ...

Calculate fps (frames per second) for iphone app

I am using an opengl es iphone application. What is the most accurate way to calculate the frames per second of my application for performance tuning?

Java - Zoom / 3D Data Visualization Libraries

What are the best libraries/frameworks for doing 3D and/or Zoom interfaces in Java? I d like to be able to do some prototyping of creating new types of interfaces for navigating within data and ...

FLTK in Cygwin using Eclipse (Linking errors)

I have this assignment due that requires the usage of FLTK. The code is given to us and it should compile straight off of the bat, but I am having linking errors and do not know which other libraries ...

热门标签