Original Post
🔒 Locked
Texture tutorials?
Advertisement
Do you mean generating textures at runtime (say, procedural textures, for example creating a noise texture), or rendering to a texture?
If it's the first one, you just need to fill an array with the texture data and create the texture using it.
If it's the second one, a quick googling of "directx render to texture" seems to give some results...
If it's the first one, you just need to fill an array with the texture data and create the texture using it.
If it's the second one, a quick googling of "directx render to texture" seems to give some results...
Interesting, I think it's render to texture.
Render to texture isnt the same as render to surface is it? If I wanted to, say, alpha out any given part of a texture which method should I use? I've also seen some examples of render to texture using 3d models, this is for a 2d game just in case it's relevant.
Thanks
Render to texture isnt the same as render to surface is it? If I wanted to, say, alpha out any given part of a texture which method should I use? I've also seen some examples of render to texture using 3d models, this is for a 2d game just in case it's relevant.
Thanks
Render to texture and render to surface is the same (a texture is mostly a surface, technically); what kind of effect are you trying to achieve?
Also what do you use: fixed pipeline, shader model 1/2/3/4/5? Because that kind of changes the possibilities a lot...
For example regarding your masking out of alpha (I assume you mean ignoring the alpha channel, though it could mean many things), with the fixed pipeline you'd use the texture stage states, otherwise it'd be HLSL. If it's to render to a texture without the alpha channel, you can also use the depth state mask, etc... many possibilities, so you'll have to provide more details :)
Also what do you use: fixed pipeline, shader model 1/2/3/4/5? Because that kind of changes the possibilities a lot...
For example regarding your masking out of alpha (I assume you mean ignoring the alpha channel, though it could mean many things), with the fixed pipeline you'd use the texture stage states, otherwise it'd be HLSL. If it's to render to a texture without the alpha channel, you can also use the depth state mask, etc... many possibilities, so you'll have to provide more details :)
What I meant with alpha out parts of a texture was remove them in-game, like you have a drawing and you erase a part of it or even cut it out to make it see-through. What I am trying to do is have object A shot object B and have part of object B's image chipped/destroyed away, though right now I just want to know how to do this type of work with textures.
Aren't shaders and the fixed pipeline mostly for 3d?
Aren't shaders and the fixed pipeline mostly for 3d?
Quote:Stencil buffers were typically used for this, but you could easily use textures instead and thus gain access to the alpha channel as a result.
Original post by Antonym
What I meant with alpha out parts of a texture was remove them in-game, like you have a drawing and you erase a part of it or even cut it out to make it see-through. What I am trying to do is have object A shot object B and have part of object B's image chipped/destroyed away, though right now I just want to know how to do this type of work with textures.
If you render image A to a texture and image B to a texture you can then composite them together as a post-processing step using a pixel shader and perform all sorts of transitions - slides, swipes, blurs, disolves, fades... and if you want per-pixel control you could feed in an alpha texture with the appropriate parts faded in/out as you see fit.
Quote:As per the name - Direct3D - if you're doing 2D you're doing 2D-in-3D. Same hardware, same software. [wink]
Original post by Antonym
Aren't shaders and the fixed pipeline mostly for 3d?
Have a look at the "PostProcess" sample in the SDK to see the possibilities of using shaders for rendering effects. They open a HUGE number of doors.
hth
Jack
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement