Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
GPU
GPU
The GLSL shader is supported by V-Ray GPU within limitations. Below you can find detailed information about the GPU support.

 

FeatureGPU Support
Built-in variables
gl_NormalMatrix Always identity matrix.
gl_ModelViewMatrixTranspose Always identity matrix.
gl_TextureMatrix Always identity matrix.
gl_TextureMatrixInverse Always identity matrix.
gl_TextureMatrixInverseTranspose Always identity matrix.
gl_TextureMatrixTransposeAlways identity matrix.
gl_ModelViewMatrixInverseTranspose Always identity matrix.
gl_FogFragCoord Always is a zero.
gl_TexCoord[] All gl_TexCoord[]  elements are identical, i.e. multiple UVW channels are not supported. 1
Built-in functions
dFdx(); dFdy() Always return zero.
fwidth() Always returns zero.
V-Ray extensions to GLSL
vr_Velocity Always is a zero.
vr_NumSuperSamples Always is 1.
vr_SuperSampleIndex Always is 1.
vr_TextureDu[] Not supported.
vr_TextureDv[] Not supported.
vr_VertexData[] Not supported.
vr_FrameData 

Only the following are supported:

vr_FrameData.focalLength
vr_FrameData.aperture
vr_FrameData.dofFocus
vr_FrameData.dofRadius
vr_FrameData.imageResolution
vr_FrameData.imagePlaneOffset

 vr_trace() Not supported.
vr_evalLight() 

Not supported. If attempted to call it will assign the following constants to the output light iterator:

light.dot_nl = -1.0
light.contribution = vec3(0.0, 0.0, 0.0)
light.direction = vec3(0.0, 0.0, 0.0)

 vr_intersect()  Not supported.
BRDF

Only the following BRDF calls are supported 2:

vr_brdf_diffuse()
vr_brdf_glass()
vr_brdf_mirror()
vr_brdf_ggx()

 Keywords

The following keywords are ignored: 

__channel 

__persistent 

__native 


Examples

...

 

Example: Cool Metallic

...

Fancy Bullets
typecircle
  • OpenGL Shading Language specification officially supported is 1.10.59
  • texture() is a synonym for texture2D(). It was added for compatibility with shaders written in GLSL 1.5. The V-Ray implementation of GLSL follows the GLSL 1.10 specification, but with a bunch of extensions to support more modern codebases. The texture() function overload is one of them. Additionally, there is another set of texture overloads: vec4 texture2D(sampler2D sampler, int reserved) and vec4 texture(sampler2D sampler, int reserved), which are equivalent. They can be used to sample the given texture at the current UV-coordinates of the current intersection point, as these overloads do not require to explicitly specify a coord argument. The reserved parameter is not used and should be -1. These fixed-coordinates sampling functions are only available in V-Ray though and ideally one should guard such calls in #ifdef _VRAY_GLSL_ blocks.

 

Footnotes

...

Anchor
1
1

1 – This is still work in progress.

...