Start simplifying cloud shader

This commit is contained in:
2025-10-29 11:14:08 +00:00
parent 042bd6bc01
commit 5f0ab2223d
3 changed files with 20 additions and 24 deletions
+6 -3
View File
@@ -16,12 +16,15 @@ void main()
// when a light is direcly above the cloud
float d = dot(vControls,vControls);
if (d > 1) {discard;}
//fCol = vCol;
fCol = vec4(vCol.xyz,vCol.w*(1-d));
//fCol = vCol;
//float rad = vCenterSize.w*0.5;
float rad = vCenterSize.w;
float h = (1-d) * rad;
fPos = vec4(vPosID.xy, vPosID.z + h, vCol.w*(1-d));
vec3 fn1 = fPos.z*normalize(vec3(vCenterSize.xyz - fPos.xyz));
fNorm = vec4(fn1,fPos.w);
//vec3 vCen =
//vec3 fn1 = fPos.z*normalize(vec3(vCenterSize.xyz - fPos.xyz));
vec3 fn1 = fPos.z*normalize(vec3(vCenterSize.xy - vPosID.xy,0));
//fNorm = vec4(fn1,fPos.w);
fNorm = vec4(vControls.xy, 0.1 ,fPos.w);
}
+2 -2
View File
@@ -20,8 +20,8 @@ void main()
vec4 a1 = theMat * p1;
vec4 a2 = theMat * p2;
// if (0 > isLHS (a1.xy - a2.xy, a1.xy - "viewFromPoint")) {
vec4 p3 = vec4 (p1.xy,500,1); //note the random z value, used for GL_DEPTH_CLAMP
vec4 p4 = vec4 (p2.xy,500,1);
vec4 p3 = vec4 (p1.xy,5000,1); //note the random z value, used for GL_DEPTH_CLAMP
vec4 p4 = vec4 (p2.xy,5000,1);
vec4 a3 = theMat * p3;
vec4 a4 = theMat * p4;
gPos = p1;gl_Position = a1; EmitVertex();