Sign in to follow this  

Multiple Projected Textures

This topic is 3106 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I am working on a RPG type game (in DX9) which will require multiple projective textures (Spell Effects, Shadows, Target Rings and maybe more), most would be orthographic and non-wrapping. At this point I don't know the maximum number I will need however I can foresee it being quite alot. I can see two ways of rendering scenes: a) What i believe is the standard method, Render each scene passing texcoords from the VS then preforming look up in the PS. As I understand this is limited by the maximum value of n (TexCoord[n]) which the card supports and/or memory available for transformation matrices. With this I could split projection into chunks, and alpha bend additional projected textures. The disadvantage of which is I would need a separate pass for each projection which different Blend Mode or PS. b) Render the scene with no textures projected (could be optimized to include some using the above method), then build a quad which encloses pixels which 'could' be part of the projection. The PS would then project back onto the projection plane to get tex-coords. This would mean I only render the scene once no-matter the number of projections / 'effects'. However the projection needs to occur per pixel rather than vertex. So I guess the question is, am I on the right track? Which would you use? and is there another way of doing it?

Share this post


Link to post
Share on other sites
I would just use as many render passes as needed. You can partition your rendering based on the blend modes. Of course, the more work you can cram into a single pass, the better - but there exists a critical point where the "cram" operation takes more time than the actual rendering.

If you end up rendering many complex passes, it is wise to do a z-only pass so as to fill the z-buffer. This way, you will save considerable amounts of fill rate in the subsequent passes, as invisible geometry will not cause pixel shader invocations (unless you modify the depth in PS). Also, z-only rendering is commonly twice as fast as color+depth rendering.

Share this post


Link to post
Share on other sites
Thanks guys.

I think it will be best if I go with a combination of both. I think there will be a point where the first method becomes quicker than the second (doing 8 textures parallel > doing 8 textures serial).

Share this post


Link to post
Share on other sites

This topic is 3106 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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