You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The textureSize function was only added in GLSL 1.30 and GLES 3.0 so at present it's not possible to create or use shaders that rely upon or make use of texture aspect ratios or pixel calculations as there's no good way to pass texture dimensions to a shader program.
Would it be possible to add this information as standard under a predictable name? I'd suggest something like resN to mirror texN, such that uniform vec2 res0 would hold the pixel dimensions of tex0 and so on for the available textures. The data (at least for tex0) is already available to the Transform at the time shader uniforms are being set, so this seems like it could be a quick and simple win.
Would be happy to PR a basic version of this. 🙂
The text was updated successfully, but these errors were encountered:
a8e2cc0 fixes this. I didn't think your PR was correct - you're using the resolution of the Model, which is in virtual pixels, rather than the resolution of the actual texture, which is in drawable-space pixels. I also made this change as the uniform is loaded, provided that it's loaded from a GLTexture (which it should be everywhere except for the texture loader.)
The
textureSize
function was only added in GLSL 1.30 and GLES 3.0 so at present it's not possible to create or use shaders that rely upon or make use of texture aspect ratios or pixel calculations as there's no good way to pass texture dimensions to a shader program.Would it be possible to add this information as standard under a predictable name? I'd suggest something like
resN
to mirrortexN
, such thatuniform vec2 res0
would hold the pixel dimensions oftex0
and so on for the available textures. The data (at least for tex0) is already available to the Transform at the time shader uniforms are being set, so this seems like it could be a quick and simple win.Would be happy to PR a basic version of this. 🙂
The text was updated successfully, but these errors were encountered: