Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualFromShadow

Posted 03 January 2013 - 05:13 AM

I'm afraid to post the whole shader code due to copyright issues. If you have the book, it is printed in chapter 2.3. I wanted to use the original shader to prevent error infusion.

What I can do is post my own adaptation of that code. It uses the original math/shader, but I added hardware instancing, so it should be ok. I also attached the class that manages the buffers.
My main change is that the texture coordinates are now in input.Position.xy instead of weights.zw

I applied your change to both versions, i.e. use float2 instead of float4 for the texture coordinates und tex2D instead of tex2Dproj. The output is the same every time.

#3FromShadow

Posted 03 January 2013 - 05:13 AM

I'm afraid to post the whole shader code due to copyright issues. If you have the book, it is printed in chapter 2.3. I wanted to use the original shader to prevent error infusion.

What I can do is post my own adaptation of that code. It uses the original math/shader, but I added hardware instancing, so it should be ok. I also attached the class that manages the buffers.
My main change is that the texture coordinates are now in input.Position.xy instead of weights.zw

I applied your change to both versions, i.e. use float2 instead of float4 for the texture coordinates und tex2D instead of tex2Dproj. The output is the same every time.

#2FromShadow

Posted 03 January 2013 - 05:12 AM

I'm afraid to post the whole shader code due to copyright issues. If you have the book, it is printed in chapter 2.3. I wanted to use the original shader to prevent error infusion.

What I can do is post my own adaptation of that code. It uses the original math/shader, but I added hardware instancing, so it should be ok. I also attached the class that manages the buffers.
My main change is that the texture coordinates are now in input.Position.xy instead of weights.zw

I applied your change to both versions, i.e. use float2 instead of float4 for the texture coordinates und tex2D instead of tex2Dproj. The output is the same every time.

#1FromShadow

Posted 03 January 2013 - 05:10 AM

I'm afraid to post the whole shader code due to copyright issues. If you have the book, it is printed in chapter 2.3. I wanted to use the original shader to prevent error infusion.

 

What I can do is post my own adaptation of that code. It uses the original math/shader, but I added hardware instancing, so it should be ok. I also attached the class that manages the buffers.

 

I applied your change to both versions, i.e. use float2 instead of float4 for the texture coordinates und tex2D instead of tex2Dproj. The output is the same every time.


PARTNERS