Discussions for Scenes for Version 1.2.X Fullscreen Mode here
iStripperに関する全て
December 29, 2016, 5088 アンサー
When Passing Parameters or Textures to a Shader
The Number of items depends on how the Shader is written.
Take a look at the combine.fsh shader.
It defines 3 sampler2D labeled texture0, 1, and 2
then compare that to the Sprite Node, and you see Three Sources also Labeled 0,1,2
The shader then performs a function on the Three textures that have been passed to it.
uniform sampler2D texture0; // = fboWithClip,0
uniform sampler2D texture1; // = fbo2,1
uniform sampler2D texture2; // = fboNormalClip,2
...
highp vec4 back = texture2D(texture0, vTexCoord.xy);
highp vec4 front = texture2D(texture1, vTexCoord.xy);
highp vec4 clip = texture2D(texture2, vTexCoord.xy);
//https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/lighting.php
gl_FragColor = ((( back + front ) ) * gl_Color);
gl_FragColor.rgb = gl_FragColor.rgb - vec3( min(0.2, abs(0.5-vTexCoord.x)) * 1.0 );
gl_FragColor.a = clip.a;
in the Xmas Scene
it looks to be Combining the Color of texture0 ( back) with texture1 (front) , using the alpha channel of texture2 (clip )
this simulates the light from the Background Fire casting a glow on the Model.
the highp means use high Precision math..
https://en.wikibooks.org/wiki/GLSL_Programming/Vector_and_Matrix_Operations