Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualphil_t

Posted 23 October 2012 - 11:54 PM

You could also do dynamic branching to avoid texture fetches for textures that have zero for their mask (right now you're always doing all 16 texture fetches).

To do this you'll need to add the [branch] attribute before each if statement, and then switch from using tex2D to tex2Dlod (and calculate the miplevel manually outside the branch (see here for an example)).

I gotten significant performance improvements from doing this.

Of course this would only make sense if you have large portions of your terrain where the mask is 0 for some textures.

#1phil_t

Posted 23 October 2012 - 11:52 PM

You could also do dynamic branching to avoid texture fetches for textures that have zero for their mask.

To do this you'll need to add the [branch] attribute before each if statement, and then switch from using tex2D to tex2Dlod (and calculate the miplevel manually outside the branch (see here for an example)).

I gotten significant performance improvements from doing this.

Of course this would only make sense if you have large portions of your terrain where the mask is 0 for some textures.

PARTNERS