Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1101 Excellent

About Volgogradetzzz

  • Rank
  1. Hi community. As a part of a learning process I wrote an article. Maybe someone will find it useful too.
  2. Volgogradetzzz

    How To Use Dx Ortho Projection Matrix

    You can find a better documentation here: D3DXMatrixOrthoOffCenterLH and D3DXMatrixOrthoLH.
  3. Volgogradetzzz

    How to get patch id in domain shader.

    Hi Jason, it's a good solution, thank you. But if I understood you correctly, your approach is basically the same as drawing with indices. If I would have a set of points as one constant/structured buffer, I have to pass the id of a point as a vertex data, right? So, drawing the same patch multiple times will require to duplicate vertices. And I need a unique sequential patch id for coloring entire patch. So in domain shader a could sample structured buffer of colors.
  4. Volgogradetzzz

    How to get patch id in domain shader.

    Thank you @MJP. That make sense. And actually documentation says that though I had to read it several times to understand.   @Matias is it still true if I have a pass-through vertex shader?   And maybe you can help me with my scenario. I have a big buffer with all control points. A have several index buffers for patches. Some patches should be drawn multiple times with different transformation. So if I want to draw everything in one call I have to duplicate indices. Right now I'm drawing each patch in it's own draw call and for patches that need to be drawn multiple times I'm using instancing. Here's a problem - for each new instance SV_PrimitiveID resets to 0. SV_InstanceID is not available in hull/domain shader and I have to pass it from vertex shader unnecessary duplicating data. Looks like instancing not works very well with tessellation.
  5. Greetings,   In my domain shader I want to sample a structured buffer with current patch id. I specified SV_PrimitiveID as input parameter but the value is 0 for all patches. And to be honest I don't see how the pipeline can provide a patch id if I draw each patch with separate draw call (DrawIndexedInstanced()). But the documentation says I can use it for patch id.
  6. Thanks guys. I understood, the waiting for the queue signal not necessary here. Thought it can be used to make sure that operation completed and release the temporary upload heap.   p.s.: I just realized that @iedoc is an author of amazing directx tutorials and I want to say thank you, I was followed your posts for a long time :).
  7. That sounds interesting. Can you please elaborate it a bit more? Why do you use 3 command lists? I don't see a problem of doing the same with only one. What do you mean by copy from upload to default - call one of the command list's copy methods? What do you mean by shader read state?
  8. Thank you guys, now it's crystal clear.
  9. Thank you iedoc, now it's almost clear. The last piece of puzzle is synchronization. When I map gpu memory and memcpy the data it's not available on the gpu immediately. It can happen that actual drawing in gpu can happen before constant data arrive from cpu. This is theory, because I never saw any sync in all samples I investigated. And btw, how can I synchronize, the mapping is not a part of queue/command list api so I can't set a signal or put a barrier on it?
  10. Thanks @Hodgman.     I'm afraid I didn't get it. Can I ask you to explain it in more detail, with the code maybe?
  11. Hello,   This topic is super confusing for me and I hope you'll help me to understand it better. Here several usage scenarios:   1. I have n objects and for every object I need to change a constant data before draw. Let's say the constant data ConstData have one integer field and is different for every object. I have a constant buffer consBuffer and I need to update it. In pseudo code: ConstData cd; cd.data = 1; ptr = consBuffer.Map(); memcpy(ptr, cd); constBuffer.Unmap(); draw(obj1); cd.data = 2; ptr = consBuffer.Map(); memcpy(ptr, cd); constBuffer.Unmap(); draw(obj2); ... It well known that draw doesn't happen immediately but goes to the gpu queue for later execution. And from the code I wrote I see that when the gpu is ready to actually draw object1 the constant data will be overridden by later calls to memcpy. Does that mean that I need to have a different constant buffer for every object? So if I have 100 objects and 2 back buffers I need 100 * 2 = 200 constant buffers. Is it right?   2. If I want to store a constant data directly in root signature, can I update the root signature before every draw call? Taking my previous example, I will not have calls to Map()/memcpy()/Unmap(), but will write directly to signature. Do I need to wait until previous object or frame finished rendering?   3. If I have rarely changed constant buffer, a projection matrix, for example, do I need to have different constant buffers for every render target? In other words, if projection matrix was changed can I safely update buffer only once and hope that changes will propagate to all frames in the queue?    
  12. Thank you guys. But still not very clear. What is this formula does: ftp://ftp.sgi.com/opengl/contrib/blythe/advanced99/notes/img166.gif It looks like vector length, but what is this -1 term?
  13. Greetings,   I like matcap technique for it's simplicity. Before I used just view space normal as lookup but recently I found this article which uses a reflection vector and a fancy formula for lookup coordinates. What is the math behind this formula?
  14. Greetings.   The topic's name is a bit misleading - I didn't know how to best name it. I'll describe here what I'm doing.   I'm writing very simple engine for rendering 3d models (surprise!). I want to encapsulate 3d object data in separate class - Object3D. This class have vertex buffers, index buffer, shaders, input layout, rasterizer state. Later I want to draw it but this information that I have in object is not enough. For example, I'm using separate (non-interleaved) vertex buffers for every element and when I'm supplying them to IASetVertexBuffers I need to provide strides and offsets. Offsets are simple in my case - they are all zeroes. With strides I have to use correct numbers, like here: vector<UINT> strides{ static_cast<UINT>(sizeof(XMFLOAT3)), static_cast<UINT>(sizeof(XMFLOAT3)), static_cast<UINT>(sizeof(uint32_t)) }; Right now I'm supplying manually this values together with all necessary data. But I don't want. I have vertex buffers, input layout but I can't grab this info from there.   The next question arises when I'm starting to draw. In DrawIndexed I have to provide number of indices. Again, I can't get this info from my index buffer and I'm supplying this data manually.   I hope it's clear what I wrote. Please if you have questions - ask and I'll refine my essay.
  15. Greetings,   I'm a programmer and I'm interested in programmatic character animation - walk, run, bipedal, many-legs creatures etc. What is the state of the art today? I heard about NaturalMotion's Euphoria system. Also I saw Ubisoft's IK Rig system. They look amazing. Where can I find info about similar algorithms?
  • 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!