vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
grass_shaders_source.h File Reference

Go to the source code of this file.

Variables

const char * lowDetailVertexShaderSource
 
const char * lowDetailFragmentShaderSource
 
const char * detailedVertexShaderSource
 
const char * detailedFragmentShaderSource
 

Variable Documentation

const char* detailedFragmentShaderSource
Initial value:
=
" uniform sampler2D texture; \n"
" uniform vec4 neutralColor; \n"
" void main( void ) \n"
" { \n"
" gl_FragColor = mix( neutralColor, \n"
" texture2D(texture, gl_TexCoord[0].xy), \n"
" gl_TexCoord[0].z \n"
" ); \n"
" } \n"
const char* detailedVertexShaderSource
const char* lowDetailFragmentShaderSource
Initial value:
=
" uniform sampler2D far_soil; \n"
" uniform sampler2D far_grass; \n"
" varying float angle; \n"
" varying float distance; \n"
" void main( void ) \n"
" { \n"
" vec4 soilColor = texture2D(far_soil, gl_TexCoord[0].st, -2.0); \n"
" vec4 grassColor = texture2D(far_grass, gl_TexCoord[0].st, -2.0); \n"
" gl_FragColor = mix(soilColor, grassColor, distance); \n"
" } \n"
const char* lowDetailVertexShaderSource
Initial value:
=
" varying float angle; \n"
" varying float distance; \n"
" uniform float maxVisibility; \n"
" uniform float minVisibility; \n"
" void main() \n"
" { \n"
" gl_Position = ftransform(); \n"
" angle = 1.0 - max(0.0, dot(vec3(0.0, 0.0, 1.0), gl_NormalMatrix * gl_Normal)); \n"
" distance = smoothstep(minVisibility, maxVisibility, \n"
" length(gl_ModelViewMatrix * gl_Vertex)); \n"
" gl_TexCoord[0].st = gl_MultiTexCoord0.st; \n"
" } \n"