mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
format glsl files
This commit is contained in:
parent
ad94402400
commit
4cb60940f8
@ -6,8 +6,7 @@ uniform mat3 colorMatrixLeft;
|
|||||||
uniform mat3 colorMatrixRight;
|
uniform mat3 colorMatrixRight;
|
||||||
|
|
||||||
float lin(float c) {
|
float lin(float c) {
|
||||||
return c <= 0.04045 ? c * 0.0773993808 :
|
return c <= 0.04045 ? c * 0.0773993808 : pow(c * 0.9478672986 + 0.0521327014, 2.4);
|
||||||
pow( c * 0.9478672986 + 0.0521327014, 2.4 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 lin(vec4 c) {
|
vec4 lin(vec4 c) {
|
||||||
@ -19,18 +18,12 @@ float dev( float c ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
|
||||||
vec2 uv = vUv;
|
vec2 uv = vUv;
|
||||||
|
|
||||||
vec4 colorL = lin(texture2D(mapLeft, uv));
|
vec4 colorL = lin(texture2D(mapLeft, uv));
|
||||||
vec4 colorR = lin(texture2D(mapRight, uv));
|
vec4 colorR = lin(texture2D(mapRight, uv));
|
||||||
|
|
||||||
vec3 color = clamp(
|
vec3 color = clamp(colorMatrixLeft * colorL.rgb + colorMatrixRight * colorR.rgb, 0., 1.);
|
||||||
colorMatrixLeft * colorL.rgb +
|
|
||||||
colorMatrixRight * colorR.rgb, 0., 1. );
|
|
||||||
|
|
||||||
gl_FragColor = vec4(
|
|
||||||
dev( color.r ), dev( color.g ), dev( color.b ),
|
|
||||||
max( colorL.a, colorR.a ) );
|
|
||||||
|
|
||||||
|
gl_FragColor = vec4(dev(color.r), dev(color.g), dev(color.b), max(colorL.a, colorR.a));
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
varying vec2 vUv;
|
varying vec2 vUv;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vUv = vec2(uv.x, uv.y);
|
vUv = vec2(uv.x, uv.y);
|
||||||
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user