mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
17 lines
483 B
Text
17 lines
483 B
Text
uniform sampler2D _MainTex;
|
|
uniform sampler2D _RampTex;
|
|
varying vec2 varUV;
|
|
void main()
|
|
{
|
|
vec4 orig = texture2D (_MainTex, varUV);
|
|
|
|
// There was a bug where these three texture
|
|
// samples were "vectorized" in a wrong way, like
|
|
// t.xyz = texture2DProj (_RampTex, t.xyz).xyz;
|
|
|
|
float rr = texture2D (_RampTex, orig.xx).x;
|
|
float gg = texture2D (_RampTex, orig.yy).y;
|
|
float bb = texture2D (_RampTex, orig.zz).z;
|
|
vec4 color = vec4 (rr, gg, bb, orig.w);
|
|
gl_FragData[0] = color;
|
|
}
|