Aded shaders for various combinations of layers.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14637 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
char terrain_displacement_mapping_CCC_frag[] = "uniform sampler2D colorTexture1;\n"
|
||||
"uniform sampler2D colorTexture2;\n"
|
||||
"uniform sampler2D colorTexture3;\n"
|
||||
"\n"
|
||||
"varying vec2 texcoord;\n"
|
||||
"varying vec4 basecolor;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" const float multiplier = 1.0/3.0;\n"
|
||||
" vec4 color = texture2D( colorTexture1, texcoord)*multiplier +\n"
|
||||
" texture2D( colorTexture2, texcoord)*multiplier +\n"
|
||||
" texture2D( colorTexture3, texcoord)*multiplier;\n"
|
||||
"\n"
|
||||
" gl_FragColor = basecolor * color;\n"
|
||||
"}\n"
|
||||
"\n";
|
||||
@@ -0,0 +1,15 @@
|
||||
char terrain_displacement_mapping_CC_frag[] = "uniform sampler2D colorTexture1;\n"
|
||||
"uniform sampler2D colorTexture2;\n"
|
||||
"\n"
|
||||
"varying vec2 texcoord;\n"
|
||||
"varying vec4 basecolor;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" const float multiplier = 1.0/2.0;\n"
|
||||
" vec4 color = texture2D( colorTexture1, texcoord)*multiplier +\n"
|
||||
" texture2D( colorTexture2, texcoord)*multiplier;\n"
|
||||
"\n"
|
||||
" gl_FragColor = basecolor * color;\n"
|
||||
"}\n"
|
||||
"\n";
|
||||
@@ -0,0 +1,11 @@
|
||||
char terrain_displacement_mapping_C_frag[] = "uniform sampler2D colorTexture1;\n"
|
||||
"\n"
|
||||
"varying vec2 texcoord;\n"
|
||||
"varying vec4 basecolor;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" vec4 color = texture2D( colorTexture1, texcoord);\n"
|
||||
" gl_FragColor = basecolor * color;\n"
|
||||
"}\n"
|
||||
"\n";
|
||||
@@ -0,0 +1,18 @@
|
||||
char terrain_displacement_mapping_flat_vert[] = "varying vec2 texcoord;\n"
|
||||
"varying vec4 basecolor;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" texcoord = gl_MultiTexCoord0.xy;\n"
|
||||
"\n"
|
||||
" float height_center = 0;\n"
|
||||
"\n"
|
||||
" // note, need to introduce a proper lighting computation based on the gl_Normal.xyz\n"
|
||||
" vec3 normal = vec3(0.0, 0.0, 1.0);\n"
|
||||
" float intensity = normal.z;\n"
|
||||
" basecolor = vec4(intensity, intensity, intensity, 1.0);\n"
|
||||
"\n"
|
||||
" vec3 position = gl_Vertex.xyz + gl_Normal.xyz * height_center ;\n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);\n"
|
||||
"};\n"
|
||||
"\n";
|
||||
@@ -1,21 +1,7 @@
|
||||
char terrain_displacement_mapping_frag[] = "uniform sampler2D colorTexture1;\n"
|
||||
"uniform sampler2D colorTexture2;\n"
|
||||
"uniform sampler2D colorTexture3;\n"
|
||||
"\n"
|
||||
"varying vec2 texcoord;\n"
|
||||
"varying vec4 basecolor;\n"
|
||||
char terrain_displacement_mapping_frag[] = "varying vec4 basecolor;\n"
|
||||
"\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" float multiplier = 1.0/3.0;\n"
|
||||
" vec4 color = texture2D( colorTexture1, texcoord)*multiplier +\n"
|
||||
" texture2D( colorTexture2, texcoord)*multiplier +\n"
|
||||
" texture2D( colorTexture3, texcoord)*multiplier;\n"
|
||||
"\n"
|
||||
"#if 1\n"
|
||||
" gl_FragColor = basecolor * color;\n"
|
||||
"#else\n"
|
||||
" gl_FragColor = basecolor;//basecolor * color;\n"
|
||||
"#endif\n"
|
||||
" gl_FragColor = basecolor;\n"
|
||||
"}\n"
|
||||
"\n";
|
||||
|
||||
Reference in New Issue
Block a user