Pārlūkot izejas kodu

tutorial: GLSL ES compilation fixes.

legacy
Sam Hocevar sam pirms 11 gadiem
vecāks
revīzija
1b14ba8860
2 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  1. +4
    -0
      tutorial/02_cube.lolfx
  2. +11
    -0
      tutorial/03_noise.lolfx

+ 4
- 0
tutorial/02_cube.lolfx Parādīt failu

@@ -17,6 +17,10 @@ void main(void)

#version 120

#if defined GL_ES
precision highp float;
#endif

varying vec3 pass_Color;

void main(void)


+ 11
- 0
tutorial/03_noise.lolfx Parādīt failu

@@ -46,6 +46,10 @@ void main(void)

#version 120

#if defined GL_ES
precision highp float;
#endif

uniform float u_Time;

varying vec4 pass_Position;
@@ -93,11 +97,18 @@ void main(void)
test += 0.5 * (length(fract(d) - 0.5) - length(fract(d + 0.5) - 0.5));

/* Compute 4 octaves of noise */
#if defined GL_ES
vec4 n = vec4(noise3d((test > 0.0) ? fire[0] : water[0]),
noise3d((test > 0.0) ? fire[1] : water[1]),
noise3d((test > 0.0) ? fire[2] : water[2]),
noise3d((test > 0.0) ? fire[3] : water[3]));
#else
vec3 points[4] = (test > 0.0) ? fire : water;
vec4 n = vec4(noise3d(points[0]),
noise3d(points[1]),
noise3d(points[2]),
noise3d(points[3]));
#endif

vec4 color;



Notiek ielāde…
Atcelt
Saglabāt