patriciogonzalezvivo / HeNerator

script to generate HeN ipfs app exports of GLSL shaders
22 stars 1 forks source link

u_frame returns 0 #4

Closed aferriss closed 3 years ago

aferriss commented 3 years ago

Hi Patricio,

I was trying to do some debugging today, but noticed that u_frame was always returning 0 once I loaded the project in the browser. You can test with something simple like:

#ifdef GL_ES
precision highp float;
#endif

uniform int u_frame;

void main(){
  float f = fract(float(u_frame) * 0.01);
  gl_FragColor = vec4(f, f, f, 1.0)
}

I'm testing on a MPB osx 11.5.2 Chrome 94

patriciogonzalezvivo commented 3 years ago

Hi @aferriss! HeNerator is using GlslCanvas which I haven't update in a long time. I believe u_frame is newer and not implemented on it yet. I will try to add it later today

patriciogonzalezvivo commented 3 years ago

This commit add support for u_frame. Thanks @aferriss for spot it https://github.com/patriciogonzalezvivo/HeNerator/commit/9a5453907da2eab3442efdf9e08e8fad2ab0281d