mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
VBO-related optimizations and improvements (#14395)
This commit is contained in:
parent
d85c842ce9
commit
bb7f57b095
22 changed files with 439 additions and 322 deletions
17
client/shaders/cloud_shader/opengl_fragment.glsl
Normal file
17
client/shaders/cloud_shader/opengl_fragment.glsl
Normal file
|
@ -0,0 +1,17 @@
|
|||
uniform vec4 fogColor;
|
||||
uniform float fogDistance;
|
||||
uniform float fogShadingParameter;
|
||||
varying vec3 eyeVec;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 col = varColor;
|
||||
|
||||
float clarity = clamp(fogShadingParameter
|
||||
- fogShadingParameter * length(eyeVec) / fogDistance, 0.0, 1.0);
|
||||
col.rgb = mix(fogColor.rgb, col.rgb, clarity);
|
||||
|
||||
gl_FragColor = col;
|
||||
}
|
21
client/shaders/cloud_shader/opengl_vertex.glsl
Normal file
21
client/shaders/cloud_shader/opengl_vertex.glsl
Normal file
|
@ -0,0 +1,21 @@
|
|||
uniform vec4 emissiveColor;
|
||||
|
||||
varying lowp vec4 varColor;
|
||||
|
||||
varying vec3 eyeVec;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = mWorldViewProj * inVertexPosition;
|
||||
|
||||
#ifdef GL_ES
|
||||
vec4 color = inVertexColor.bgra;
|
||||
#else
|
||||
vec4 color = inVertexColor;
|
||||
#endif
|
||||
|
||||
color *= emissiveColor;
|
||||
varColor = color;
|
||||
|
||||
eyeVec = -(mWorldView * inVertexPosition).xyz;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
uniform vec4 starColor;
|
||||
uniform vec4 emissiveColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_FragColor = starColor;
|
||||
gl_FragColor = emissiveColor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue