Jump to content

Filter with depth map


Exca
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...