Jump to content
  • Advertisement
Sign in to follow this  
Negative201

Multiple Projected Textures

This topic is 3326 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!