Exca Posted November 25, 2016 Share Posted November 25, 2016 I have a situation where I need to apply calculations based on a map for my sprite. Currently I have sprite with filter calculating the results. The problem is that the vTextureCoords are in filterareas space and the map texture is not the same size. So this wont work as the areas dont match: vec4 color = texture2D(uSampler,vTextureCoord); vec4 map = texture2D(uMap,vTextureCoord); I could fix it by calculating the area to use and giving the boundaries as uniforms to shader and then using uv's normalized to screenspace. Is that the correct way or is there some way how I could get the area more efficiently? Quote Link to comment Share on other sites More sharing options...
Exca Posted November 25, 2016 Author Share Posted November 25, 2016 Answering myself. Use a solution like in displacement map filter and then just use the vFilterCoord to read the map. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.