Skip to content

Instantly share code, notes, and snippets.

@DDR0
Created December 14, 2020 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DDR0/ed63d4cae9a66ee557cf82a37d3bd04f to your computer and use it in GitHub Desktop.
Save DDR0/ed63d4cae9a66ee557cf82a37d3bd04f to your computer and use it in GitHub Desktop.
water_distort_new
//in shaders.cfg:draw
set(textures, []),
if(liquid_textures[0], [
bind_texture(liquid_textures[0], 2),
set(uniform_commands.u_water_tex_0, 2),
add(textures, [liquid_textures[0]]),
]),
if(liquid_textures[1], [
bind_texture(liquid_textures[1], 3),
set(uniform_commands.u_water_tex_1, 3),
add(textures, [liquid_textures[1]]),
]),
//in shaders.cfg:fragment
texture2D(u_water_tex_0, loc + vec2(0.2, u_anura_cycle*u_water_tex_speed[water_index]))
//This does not work, returning the last texture added to textures, not the texture in slot 2 (u_water_tex_0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment