Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 31 Jan 2010
Offline Last Active Jul 10 2014 05:24 PM

#4917648 How is it possible for the output register in a pixel shader to differ from P...

Posted by relaxok on 29 February 2012 - 02:00 AM


Solved!! The person who mentioned the floating point comparisons was on the right track. I needed to be round()-ing the floats, not just casting to int. There were apparently lots of 250.999999 in there (Showing up as 251.000 in PIX) and int was rounding them down to 250 which is a different set of textures in TexIndices... and so on for other areas of the terrain.

Thanks to MaulingMonkey on gamedev irc..

And thanks to all for your suggestions, I learned a lot along the way..

#4916923 Problem passing matrices to shader

Posted by relaxok on 27 February 2012 - 02:10 AM

I do something similar, in D3D11 - differences are:

-- using XMFLOAT4X4 for the matrix variable format
-- loading to XMMATRIX and transposing with XMMatrixTranspose before storing back to XMFLOAT4X4 and mapping to cbuffer
-- not using packoffset in the cbuffer declaration
-- register(cb0) instead of register(b0) for the cbuffer

I'll look closer at what you did later, but those are differences I've found and mine works fine..

Also, your PIX doesn't exactly show the problem, for me - are those cbuffer variables in the debugger not reasonable? they're definitely not zeroed out or something.. in what way are they wrong?