mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-10 19:32:10 +00:00
Volumetric effects
This commit is contained in:
parent
cd6e304cfa
commit
22ba7449f2
15 changed files with 468 additions and 23 deletions
15
client/shaders/noise_shader/opengl_fragment.glsl
Normal file
15
client/shaders/noise_shader/opengl_fragment.glsl
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Pseudorandom number generator
|
||||
float rand(vec2 n) {
|
||||
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
|
||||
}
|
||||
|
||||
// More random pseudorandom number generator;
|
||||
float noise(vec2 p){
|
||||
vec2 p2 = p + vec2(rand(p), rand(p.yx));
|
||||
return rand(p2);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_FragColor = vec4(vec3(noise(gl_FragCoord.xy)), 1.);
|
||||
}
|
4
client/shaders/noise_shader/opengl_vertex.glsl
Normal file
4
client/shaders/noise_shader/opengl_vertex.glsl
Normal file
|
@ -0,0 +1,4 @@
|
|||
void main(void)
|
||||
{
|
||||
gl_Position = inVertexPosition;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue