Commit 372a704f authored by Michele Bosi's avatar Michele Bosi

Vivid: support for 1D, 2D, 3D textures

parent 763427a8
......@@ -71,14 +71,26 @@ vec4 LightingStage()
}
if ( vl_Vivid.enablePointSprite ) {
color = color * texture2D( vl_UserTexture, gl_PointCoord.st );
if ( vl_Vivid.textureDimension == 2 ) {
color = color * texture2D( vl_UserTexture2D, gl_PointCoord.st );
}
// More aggressive pixel discard for point sprites
if ( color.a < 0.004 ) {
discard;
}
} else
if ( vl_Vivid.enableTextureMapping ) {
color = color * texture2D( vl_UserTexture, gl_TexCoord[0].st );
if ( vl_Vivid.textureDimension == 1 ) {
color = color * texture1D( vl_UserTexture1D, gl_TexCoord[0].s );
} else
if ( vl_Vivid.textureDimension == 2 ) {
color = color * texture2D( vl_UserTexture2D, gl_TexCoord[0].st );
} else
if ( vl_Vivid.textureDimension == 3 ) {
color = color * texture3D( vl_UserTexture3D, gl_TexCoord[0].str );
}
}
return color;
......
......@@ -23,7 +23,9 @@ uniform mat4 vl_NormalMatrix;
// Texture Mapping
// <automatic>
uniform sampler2D vl_UserTexture; // Always set to vl::VividRendering::UserTexture
uniform sampler1D vl_UserTexture1D; // Always set to vl::VividRendering::UserTexture
uniform sampler2D vl_UserTexture2D; // Always set to vl::VividRendering::UserTexture
uniform sampler3D vl_UserTexture3D; // Always set to vl::VividRendering::UserTexture
// Smart Fog Stage
......@@ -109,6 +111,10 @@ struct vl_VividParameters {
// Whether to use texture mapping or not
bool enableTextureMapping;
// <automatic>
// Whether the texture is a 1D, 2D or 3D texture
bool textureDimension;
// <per-Shader>
// Whether to render points as textured point sprites
// Requires enableTextureMapping=1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment