Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 12 Apr 2010
Offline Last Active May 26 2016 05:48 AM

#5289222 Procedural character animations. What is the state of the art?

Posted by nikitablack on 29 April 2016 - 06:35 AM



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?

#5285258 [D3D12] Synchronization on resources creation. Need a fence?

Posted by nikitablack on 05 April 2016 - 08:55 AM



In D3D12HelloTriangle example there's an interesting synchronization in LoadAssets() function. They call WaitForPreviousFrame() function. I understand why we need it during a rendering. But in this particular example I can't get the purpose of a such synchronization. They are not submitting anything to the gpu (or they do???). They're using an upload heap for the single resource here - vertex buffer. As I understand the upload resource exists on the cpu side and the data is transferred every time the gpu needs it. So no need a fence here. They also create a root signature, pso, fence object itself. So maybe for this objects we need a synchronization? Is it somewhere in documentation?

#5272578 [D3D12] Is ExecuteCommandLists asynchronous, does Present stalls, how signall...

Posted by nikitablack on 25 January 2016 - 10:04 AM

Thank you guys. Now it's clear.


Recently I read Intel's article and it helped me a lot to understand swap chains. Highly recommend.

#5263254 Render GUI elements with projection matrix

Posted by nikitablack on 23 November 2015 - 08:08 AM

If you want to preserve depth you still can use ortho matrix. If you turn off depth wright, the triangles will be drawn in the order you submitted them.

#5252881 Does D3D11_BIND_UNORDERED_ACCESS and D3D11_BIND_SHADER_RESOURCE should be alw...

Posted by nikitablack on 18 September 2015 - 08:53 AM

Thank you for the explanation. It's much clearer for me now. But I think you're mistaken (a typo?) in a couple of moments:

"Shader resource" means it can be bound with *SSetShaderResources on the CPU side, and a u# register on the HLSL side (RWBuffer, RWTexture#D, etc).

But in order to write somewhere I have to use UAV, so RWBuffer is not a shader resource but UAV, right?

According to documentation (https://msdn.microsoft.com/en-us/library/windows/desktop/dd607359(v=vs.85).aspx) u# register is used for Unordered Access View and t# for Texture and texture buffer and buffers.

#5252835 Computations with DirectCompute. How to get data back?

Posted by nikitablack on 18 September 2015 - 02:31 AM



I'm trying to use my gpu for computations only (I don't even create a swap chain). But I'm not sure how to retrieve a data after shader do it's job. I want to modify the same data I passed. For this I'm using single structured buffer binded as D3D11_BIND_UNORDERED_ACCESS.


As far as I know I need to use D3D11_CPU_ACCESS_READ together with D3D11_USAGE_STAGING. But in this case I have an error:

A D3D11_USAGE_STAGING Resource cannot be bound to any parts of the graphics pipeline, so therefore cannot have any BindFlags bits set.

My next approach was to create a structured unordered buffer with D3D11_USAGE_DEFAULT usage. I applied calculations on it, next I called 


to copy this buffer to the one with D3D11_CPU_ACCESS_READ and finally read the data. But I'm not sure this is a correct way - I don't like this extra copying between resources.

#5236548 How does games manage different resolutions?

Posted by nikitablack on 24 June 2015 - 06:40 AM

Thank you, guys.


I chose this approach:

  1. Allow the user to select from available gpus with outputs (i.e. if gpu doesn't have an output - ignore it).
  2. After swap chain creation I'm requesting for an output with swapChain->GetContainingOutput()
  3. Request for supported resolutions and refresh rates.
  4. For windowed mode I'm ignoring resolution selection, just resizing as MJP said.

#5235691 How does games manage different resolutions?

Posted by nikitablack on 19 June 2015 - 08:45 AM

@ninnghazad, I see you misunderstood a question. I know how to obtain all the information I need (btw, why are you strongly suggest not do so?). All I want to know how to use this info or how other do it.


One more example - I have a laptop with 2 gpus. Obviously that only one - integrated gpu have an output. The more powerful discrete gpu don't have outputs. Following your words I should ignore it. But of course I shouldn't and in fact I'm using only it for games. But how does system knows where to output a picture in that case. Personally for me EnumOutputs() looks useless for the scenario with more that one gpu.

#5235682 How does games manage different resolutions?

Posted by nikitablack on 19 June 2015 - 07:48 AM

Hi, thank you for the answer.


I know how to setup for basic rendering. My next step in learning is to understand this low level stuff.


Description for GLFW states that it's a library for OpenGL or OpenGL ES. And we're in DirectX section, so this is not very helpful for me. Thought I got an idea, there's still a question - what to do if the user selected an adapter with zero outputs?

#5235667 How does games manage different resolutions?

Posted by nikitablack on 19 June 2015 - 06:16 AM



We all saw that every game allows to select a resolution. It looks simple but some questions doesn't give me to sleep.


  1. How can I obtain available resolutions? Just take the most popular and hardcode?
  2. I can iterate over available outputs and find supported resolutions as well as sync intervals. But what if the user selected an adapter that is not have any output bounded (actually how does this works at all - I have 2 GPUs, I can switch between them, and I always have a picture, even if a card doesn't have an output)?
  3. What if the user have several monitors. How should I choose correct one (and should I at all)?
  4. In Starcraft 2 I noticed that in windowed mode there's no resolution selection at all - I can resize a window and picture scales accordingly. How it is done? Do they have fixed resolution for the windowed mode?

#5219341 Direct3D 12 documentation is now public

Posted by nikitablack on 26 March 2015 - 09:32 AM

Hybrid notebook systems should not be currently supported

That's sad. I hope D3D_DRIVER_TYPE_REFERENCE is implemented.

#5216076 [solved] How to debug compute shader with visual studio?

Posted by nikitablack on 12 March 2015 - 09:42 AM



Debugging vertex/pixel shader works fine, but I have a problem with compute shader debug. After pressing Alt+F5 diagnostic starts, but pressing PrintScreen or CaptureFrame button does nothing.




Upd.: didn't notice this in the beginning:

Programmatic capture is especially useful for debugging compute shaders in programs that never call Present



#5214156 How to initialize Texture2DArray?

Posted by nikitablack on 03 March 2015 - 03:52 AM

Update. Everything is much more simple. It turned out that dds format supports several textures in one file. And CreateDDSTextureFromMemory() do all the job. All we need to do is just create dds with texassemble tool (https://directxtex.codeplex.com/wikipage?title=Texassemble) and supply to texture creation function.

#5209966 Clip (mask out) child by parent bounds.

Posted by nikitablack on 11 February 2015 - 03:48 AM

Nevertheless, you could implement this in a shader, just discard the pixels which are not inside the bounding rect of the parent element.


If you have only axis-aligned rectangles you can simply clip them when filling up your vertex buffer.



As I wrote in PS, I have rotating quads. Also quads can have round corners (and maybe holes) so it will be difficult to calculate it analytically. It was my mistake that I wrote about quads. I probably have to write arbitrary geometry. 


For non-rectangular regions, you could use a second texture as a mask and do manual blending (so to speak) in the pixel shader. This can of course be combined with the above approach.



This sounds interesting. Can you give more insights please?

#5209762 Does gpu guaranties order of execution?

Posted by nikitablack on 10 February 2015 - 02:39 AM

Thank you.