Jump to content
  • Advertisement

fs1

Member
  • Content Count

    121
  • Joined

  • Last visited

Community Reputation

446 Neutral

About fs1

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Thanks @MJP for all the clarification. Regards
  2. Great thanks so much for the example. Appreciate all the help, it is working now. Just one more question. In the D3D_INCLUDE_SYSTEM case, how do you handle the file path if you have different sub-folders to search in? Do you need to work on a loop to find the right file in the whole sub-folders system? Thanks
  3. Thanks @turanszkij for your explanation. I will play with it and let you know how it goes. thanks
  4. I have been trying to see how the ID3DInclude, and how its methods Open and Close work. I would like to add a custom path for the D3DCompile function to search for some of my includes. I have not found any working example. Could someone point me on how to implement these functions? I would like D3DCompile to look at a custom C:\Folder path for some of the include files. Thanks
  5. Thanks! I appreciate your help
  6. Thanks Hodgman. How portable are these commands varying from each GPU card? Do I need different FOURCC depending on the vendor?
  7. I read the article posted here:   http://www.gamasutra.com/blogs/MykhayloKotys/20150428/242150/Fast_perpixel_lit_volumetric_fog_without_depth_prepass.php   He suggests to use a Texture instead as the Scene Depth-Stencil Buffer does not have enough space (8-bit) to store the depth of a scene. Is this correct ?   I would like to proceed using the depth buffer instead of the Texture approach, but appreciate any thoughts on it.   Thanks.
  8. Ok, I understand the logic behind what you are recommending. Thanks so much.
  9. Thanks phil_t Makes sense,I will try one pass as well. Regards!
  10. I am new to Shadows in D3D9/10/11   I have been following this tutorial which is quite clear:   https://takinginitiative.wordpress.com/2011/05/15/directx10-tutorial-10-shadow-mapping/   Let's say you have drawn the scene with couple hundred of draw calls and you are about to render the shadows. The vertex shader is defined as: struct PS_INPUT { float4 pos : SV_POSITION; float4 lpos : TEXCOORD0; //vertex with regard to light view float3 normal : NORMAL; }; //-------------------------------------------------------------------------------------- // Vertex Shader //-------------------------------------------------------------------------------------- PS_INPUT VS( VS_INPUT input ) { PS_INPUT output; output.pos = mul( input.pos, mul( world, viewProj ) ); output.normal = input.normal; //store worldspace projected to light clip space with //a texcoord semantic to be interpolated across the surface output.lpos = mul( input.pos, mul( world, lightViewProj ) ); return output; } My question is, do you need to pass all Draw Calls again as a second pass, or there is a way to get the vertices previously drawn from the GPU or somehwere else? The former seems quite expensive in terms of performance.   Any clarification is highly appreciated.   Thanks !
  11. Thanks,   that worked just fine - I defined my own interpolators as you said - I was quite unaware that you can do that in D3D10 (and later).   your help was much appreciated!
  12. The matrix computation code in the vertex shader (not my code) is quite complex and has many branches depending on material flags etc.   When you say "use shader constants" - I tried to do that:   1) I enabled D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY 2) I placed two global variables "matrix_1", "matrix_2" in the shader code, whereby inside the Vertex Shader, I populate them (right before the return statement) like so: matrix matrix_1; matrix matrix_2;   VS_OUTPUT VS( VS_INPUT In ) {     VS_OUTPUT Out = (VS_OUTPUT) 0;         ... (other code calculating various things) ...     matrix_1 = calculatedMatrix1;     matrix_2 = calculatedMatrix2;     return Out; } float4 PS(VS_OUTPUT In) : SV_TARGET {     // check variable contents of matrix_1 and matrix_2 - doesn't work... }; Is that what you had in mind with 'shader constants'? I also tried to add them to constant buffers used (with the same compatibility flag), populate them in the vertex shader so that the pixel shader will receive values, that didn't work either. As I said earlier in my posts, TEXCOORD0 to TEXCOORD11 are taken already, so I can't use the 8 TEXCOORDs required for storing 2 float4x4 variables... Thanks for your help!
  13. D3D11 Shaders.   Any hints appreciated.
  14. Thanks MJP. The VS_OUTPUT struct of the vertex shader already uses most of the available TEXCOORD variables and I am looking to pass two matrices over to the pixel shader (i.e. two float4x4 variables). As I am doing this via shader injection at D3DCompile time, I don't have access to the C++ side which would enable me to possibly pass the variables to the pixel shader otherwise - it has to be done via a vertex-to-pixel shader technique. However, I cannot think of one, apart from using VS_OUTPUT TEXCOORD variables, but in this case they're not enough (two float4x4s require 8 TEXCOORDs and there are 10 used by the vertex shader already). Any further ideas?
  15. Dear All I have done some matrix calculations in the VS that I want to re utilize in the PS. The problem I am having is that the slots of my PS buffer are already taken. Any thoughts on how can I read those computations from the PS previous done in the VS? Thanks!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!