Confusion on HLSL Samplers. Can I Set Samplers Inside Functions?

Posted by Kyle Connors on Game Development See other posts from Game Development or by Kyle Connors
Published on 2012-11-23T17:07:26Z Indexed on 2012/11/23 17:20 UTC
Read the original article Hit count: 267

Filed under:
|

I'm trying to create a system where I can instance a quad to the screen, however I've run into a problem. Like I said, I'm trying to instance the quad, so I'm trying to use the same geometry several times, and I'm trying to do it in one draw call. The issue is, I want some quads to use different textures, but I can't figure out how to get the data into a sampler so I can use it in the pixel shader. I figured that since we can simply pass in the 4 bytes of our IDirect3DTexture9* to set the global texture, I can do so when passing in my dynamic buffer. (Which also stores each objects world matrix and UV data) Now that I'm sending the data, I can't figure how to get it into the sampler, and I really want to assume that it's simply not possible. Is there any way I could achieve this?

© Game Development or respective owner

Related posts about textures

Related posts about hlsl