wiselogi

Member
  • Content count

    13
  • Joined

  • Last visited

Community Reputation

116 Neutral

About wiselogi

  • Rank
    Member
  1. Geometry shader, but why ?

    This tutorial does exactly what you are looking for: http://www.geeks3d.com/20101126/direct3d-11-tessellation-tutorial/ It shows how to build any parametric surface entirely in the GPU using the tessellator in one pass.
  2. Multiple Depth Rendering

    Thinking on this more, I came up with an approach you can use UAVs(D3D11) to avoid GS overhead. I never did this approach, so, fellow forum users, pointing pitfall on this would be useful, although I dont see any (yet). Lets assume you have three depth buffers to compute. The idea here is to perform your own depth buffer operation manually, using only VS and PS. 1. Bind 2 UAVs to the PS stage 2. Make sure any frustum culling you are doing on the CPU is aware and considering all ViewProj's in the single pass now. Disable any backface culling you might be doing at Hull Shader ( if it is enabled ). 2. Pseucode below [source lang="csharp"]//lets say UAV[1-2] are your UAVs and ViewProj[1-2] are your ViewProj matrices. //inPos3D is your 3D position that came from VS //initialize all your UAVs with '1' //disable early-z culling PS() { float4 pos1 = mul(inPos3D, ViewProj1); float4 pos2 = mul(inPos3D, ViewProj2); pos1.xyz /= pos1.w; pos2.xyz /= pos1.w; float currentDepth1 = sample(pos1.xy,UAV1); //samples UAV1 at screen pos pos1.xy. //pos1.xy might not be on the screen, in that case you do nothing float currentDepth2 = sample(pos2.xy,UAV2); if(currentDepth1 > pos1.z) { //write currentDepth1 at UAV1 at pos1.xy} if(currentDepth2 > pos2.z) {//write currentDepth2 at UAV2 at pos2.xy} //do other stuff }[/source] At the end, each of the UAVs are going to have your desired depth buffer The third depth buffer you dont need a UAV, you gonna use the regular pipeline depth test.
  3. Multiple Depth Rendering

    The reason of your results is because with a VS and a PS you can only select ONE rendertarget to rasterize. So, although you are passing all the ViewProj matrices to the Pixel Shader, you selected only one to perform the rasterization, the others you are passing through TEXCOORDS semantics. So, indeed, you are going to get only different ( and meaningless) dephts in the other render targets and the same image, because you selected to rasterize only one of the Views. As MJP said, the solution is to rasterize multiple views using the Geometry Shader, you gonna pass all your ViewProj matrices and output each one to a different render target. Just like the CubeMapGS as MJP pointed. Then you can get all your depths in a single pass. Remember that enabling GS yields in a overhead for the GPU, you have to do some profiling to see if it is worthy. Regardin Ashaman73 concern, that won't happen in this case, each rendertarget will have a depth test of it's own and there will be no visibility problem.
  4. Creating Terrain

    [quote name='Medo3337' timestamp='1339279771' post='4947766'] @DJTN: Any example on creating a Shader file to blend textures on the terrain? [/quote] Riemer does exactly this on one of his tutorials. Take a look. [url="http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Multitexturing.php"]http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Multitexturing.php[/url]
  5. isnt this function what are you looking for? This rotates (x,y,z) about the axis (u,v,w) by the angle ?. f(x,y,z,u,v,w,?) = [img]http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/ArbitraryAxisRotation13x.png[/img]
  6. Hum, I liked the flying FPS camera solution, thats easy to do. Thanks for the idea Dunge, I was looking for something like this. Btw, is it hard to code those plugins for 3d modeling apps? Im wondering if I will spend most of my time converting axis directions, configuring scales and all those boring things.
  7. Hi Guys, I was using "hardcoded" values on a XML file to specify absolute world position and load my scene objects, but now that I've added quite a few objects it is quite painful to keep editing the xml file, see if my new object is on the desired position, than change the position on the XML a "little bit to the left". So, I was wondering how you guys do this annoying job if you dont have a scene editor. I'm not planning to code one, unless it is absolute necessary. Thanks!
  8. Averaging is a solution, but instead of doing that, there is a potential solution in MJP link's. And also a easier one on this http://www.google.com/url?sa=t&rct=j&q=tessellation%20displacement%20mapping%20cracks&source=web&cd=1&ved=0CB8QFjAA&url=http%3A%2F%2Fdeveloper.amd.com%2Fgpu_assets%2FWileyAuthoringforTessellation.pdf&ei=ssSFT8PcNaiyiQKWv9j1BA&usg=AFQjCNGFsjyLTbkH11jBHvTgTmLuYJgRtQ&cad=rja At page 45, they propose a filter at UV borders.
  9. This is usually called "Crack". You must have the same tessellation factor ( set it on the Hull Shader ) for each edge of a triangle that shares a cube edge, and also the displacement amount on the edges must match.
  10. Depth peeling stop criterium

    If DirectX11 or OpenGL4 is an option you can do it by creating per-pixel linked lists in one pass and process the list in another pass. The first fragment of an arbitrary screen pixel is part of layer 0 and the second is part of layer 1 and so on.
  11. 3D Graphics References

    Hey, I had the exactly same problem one year and a half ago. There are too much sparse material thorugh the web and it is so hard for a beginner to startup. Although Real-Time Rendering is a GREAT resource, I qualify it as not a beginner book. Because beginners need to get their hands dirty on something and Real-Time Rendering doesn`t provide you that, because it is not API specific ( which is good for intermediate-advanced people ). Well, I dont know if it is the best way, but I started with Riemers book: XNA programming recipes. I truly recommend starting XNA instead of OpenGL or DirectX, specially if you are not used to native code. I dont like OpenGL documentation for beginners and DirectX is too verbose. XNA provides a great abstraction to raise an application in no time. If you follow the whole riemers book and understand the recipe you will have a better knowledge of the pipeline. Then I would recommend Real Time Rendering... then you are free to look up all other books: ShaderX/GPU Pro, Game Programming Gems etc...
  12. Yeah, my concern was exactly performance. I know that clip(-1) is quite slow. About using Equal for depth test, I think that I would miss most pixels because of the precision, wouldnt I? Well, I was just wondering if there was any performance aware method to do this, but I suppose not right?
  13. Hi, Well, suppose I have a depth map and just want to render pixels that are on the specific depth of the depth map. Its not a common depth test, because I might have fragments that are closer to the camera but the depth on the depth map for that screen position is farther. I thought on this approach: 1.Render Scene 2. At pixel shader consult the depth map, if current fragment depth is within the tolerance, shade and return fragment. else clip(-1); Is this the correct approach, would it work?