kraflab / dsda-doom

This is a successor of prboom+ with extra tooling for demo recording and playback, with a focus on speedrunning and quality of life.
342 stars 87 forks source link

Shaders: handle texture dimension uniforms generically #401

Closed bkoropoff closed 1 year ago

bkoropoff commented 1 year ago

Since GLSL 1.10 doesn't let you query the size of a texture, we have to pass texture dimensions manually. Make doing this generic and automatic, and use it for the fuzz shader.

kraflab commented 1 year ago

Is there a version that does let you query the size that would be easier to use?

bkoropoff commented 1 year ago

GLSL 1.30 has textureSize, but it requires OpenGL 3.0

kraflab commented 1 year ago

What kind of benefits would be get from requiring 3.0?

bkoropoff commented 1 year ago

3.0 is generally more modern and complete, like support for integers throughout the entire stack (e.g. use non-normalized integers for indexed textures, use non-normalized integer coordinates to do colormap lookups), an overhaul of how shader inputs/outputs are specified to be more flexible and explicit, etc. It has vertex array objects, which might speed up rendering.

kraflab commented 1 year ago

If you think it's worth migrating at some point, feel free to mess around with it