• Advertisement
Sign in to follow this  
  • entries
    27
  • comments
    25
  • views
    6333

GPUPhysics: Another step towards a solution

Sign in to follow this  

94 views

Found this post written by MikeWW here.

Quote:

Hi,

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,

Mike.


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  


0 Comments


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