Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

GPUPhysics: Another step towards a solution

Sign in to follow this  


Found this post written by MikeWW here.



Basically you get the error because the compiler does not have the same level of intuition that we do when we look at the code. As far as the compiler is concerned the if/else-if block that sets stf may not actually result in stf being set.

As an aside I would recommend an alternate way of doing this anyway:

* Use a single texture to hold all 6 faces packed together somehow.
* Create a static lookup cubemap that maps the incoming 3D vector to the UV coord of the point in the faces texture.

As long as you use point sampling for both lookups everything should work out OK.

This way not only do you only need to render to one rendertarget for the light instead of 6, but you also replace a whole load of ugly math and sampler array lookup with a texture read which can be a win in some cases.

Hope this helps,


Guess it would help! Mike: You saved me! rating ++... (I can see you're from Sweden as well...)

Why is it that life always seems so much easier in the morning [lol]?
Sign in to follow this  


Recommended Comments

There are no comments to display.

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
  • 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!