Sign in to follow this  
_Flecko

Sampling textures from within a texture shader

Recommended Posts

Hi, I'm working on a texture shader that I'd like to be able to sample other textures with. However, it seems it can't sample textures given by Device.SetTexture(), and the TextureShader.SetValue() method doesn't accept Textures like Effect.SetValue() does. Is this possible? Anybody know how to do it? Thanks, Max

Share this post


Link to post
Share on other sites
Quote:
Original post by _Flecko
Hi,

I'm working on a texture shader that I'd like to be able to sample other textures with. However, it seems it can't sample textures given by Device.SetTexture(), and the TextureShader.SetValue() method doesn't accept Textures like Effect.SetValue() does. Is this possible? Anybody know how to do it?

Thanks,
Max


The texture shader virtual machine doesn't handle samplers so you don't get to use texture parameters. You could code up a "texture shader" using the reference rasterizer where you get all the device features. More work (obviously).

Paul

Share this post


Link to post
Share on other sites
Ah, thanks. The reference device is (in my experience) too slow for what I'm doing, so I think what I'll do is render a quad with my original texture to another texture, using a pixel shader that does to it what I wanted my texture shader to do.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this