Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Mar 2013
Offline Last Active Aug 01 2013 03:22 PM

Posts I've Made

In Topic: Directional Light

18 July 2013 - 03:02 PM

Are you transforming cameraPos?


If you were using visual studio 2012 you could debug the shader and inspect values after it runs.

In Topic: D3D10 question

16 July 2013 - 03:49 PM

I think it only allocates memory on the GPU. There is no reason to mirror data in CPU RAM as well. Also, you are more likely to have more RAM than GPU memory.

In Topic: Compile HLSL at Runtime ?

16 July 2013 - 10:23 AM

D3DReadFileToBlob loads from a file to a ID3DBlob, but it looks like it is only available for D3D11. I don't know if you can just fopen and fread the .cso file, but you can definitely compile at run-time the first time and just write the blob to a file. Then the next time your program runs you can just fopen the compiled file.


If you have to go with the second way then you can still have visual studio compile your shaders to make sure they are correct at build-time. You just won't actually use the object files that it produces.

In Topic: Per-Pixel Point Light

16 July 2013 - 07:36 AM

The whiteness looks like your specularity is too high (if materialPower is too big) and the darkness is something you should expect from a point light. The brightness decreases with the square of the distance. So it may be the case that it is just falling off too quickly from lightRange being too small.


VS_OUTPUT and PS_INPUT are the same thing--use a typedef or just use one of them to avoid mistakes.

In Topic: Compile HLSL at Runtime ?

15 July 2013 - 11:07 PM

It was from SV_POSITION. It used to be VPOS in D3D9.




Also I recommend using visual studio 2012 and compiling offline. My solution used to take 15 seconds to load because it compiled the shaders at run-time. I didn't have that many shaders. I switched to offline compiling and the screen comes up in under a second. It's huge for productivity. And according to some guy I'm not going to cite there's no real advantage to compiling at run-time since it increases loading by so much.