Replace switch with ifs in shader

0.6.3
Miloslav Číž 7 years ago
parent ea5e078526
commit 390838e084

@ -41,13 +41,12 @@ void main(void)
{ {
vec3 c; vec3 c;
switch (mapping) if (mapping == 0)
{ c = sphericalCoords(uv);
case 0: c = sphericalCoords(uv); break; else if (mapping == 1)
case 1: c = cylindricalCoords(uv); break; c = cylindricalCoords(uv);
case 2: c = planetCoords(uv); break; else
default: c = sphericalCoords(uv); break; c = planetCoords(uv);
}
gl_FragData[0] = textureCube(cubeMap,c); gl_FragData[0] = textureCube(cubeMap,c);
} }

Loading…
Cancel
Save