Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Oct 2005
Offline Last Active Today, 03:04 PM

Posts I've Made

In Topic: Real-Time WebSockets and REST

05 October 2015 - 09:58 AM

In regards to WebSockets I personally wouldn't bother with socket.io. You can just use the ws module for games. Falling back isn't necessary anymore for any browser or device. (Nor for a game is it really worth it).

In Topic: Uses of curves in graphics?

16 June 2015 - 07:39 PM

I've always found the CSS documentation on MDN to be a nice overview of timing functions: https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function


Also check this out: http://www.gdcvault.com/play/1020583/Animation-Bootcamp-An-Indie-Approach (It starts at movement continued with a full animation system defined by curves)

In Topic: Direct3D 12 documentation is now public

11 May 2015 - 08:13 PM


InState should be the state of the resource after the CreateWrappedResource() call, that is the state when AcquireWrappedResources is called.
OutState should be the state of the resource when you call ReleaseWrappedResources().

IE: if you need first to use the resource as render-target and you want use it for present you will set D3D12_RESOURCE_STATE_RENDER_TARGET as InState and D3D12_RESOURCE_STATE_PRESENT as OutState. When you will call CreateWrappedResource() the resource will be ready for render-target usage and after you will call ReleaseWrappedResources it will be ready for Present(). It should be like a D3D12_RESOURCE_BARRIER + D3D12_RESOURCE_BARRIER_TYPE_TRANSITION but like in a D3D11 form.


Yeah that's how I kind of figured and set it up my code dump above. Specifically I did:

hr = mD3D11On12Device->CreateWrappedResource(mTextTexture.Get(), &mD3D11TextureFlags, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, __uuidof(ID3D11Resource), (void**)mD3D11Texture.GetAddressOf());


ID3D11Resource* resourcesToAcquire[] = { mD3D11Texture.Get() };
mD3D11On12Device->AcquireWrappedResources(resourcesToAcquire, ARRAYSIZE(resourcesToAcquire));

// SetTarget BeginDraw EndDraw

mD3D11On12Device->ReleaseWrappedResources(resourcesToAcquire, ARRAYSIZE(resourcesToAcquire));

I use it in an SRV thus the out state is pixel shader resource. That does clear up any doubts I had about the usage.


I think I need to find someone with very in-depth knowledge to look at the code to find the specific issue. I've switched gears and am learning other D3D12 stuff to see if maybe I learn something relevant to help.

In Topic: Direct3D 12 documentation is now public

10 May 2015 - 05:31 PM

I've done about as much as I can to simplify my code examples for someone else to help. "D3D12-DirectWrite.zip" has an implementation that I believe should be valid. All it does is create a ID3D12Resource and then uses it as a render target that D2D and DirectWrite to render to. It calls Render() one time to render a single frame. D2D never renders to the texture though and D3D12 renders a black texture.


My current issues are in understanding ID3D11On12Device's CreateWrappedResource method. It has an "InState" and "OutState", but it's unclear to me how they should be set. They  AcquireWrappedResources and ReleaseWrappedResources also have no clear usages explained other than they seem mandatory? I assume you have to acquire the texture then render then release it when you're done, but it's not clear when this needs to be done in my code.


The last piece I'm confused about are if D3D12 has to do anything when working with D2D. D3D11On12CreateDevice accepts a ID3D12CommandQueue. I'm assuming it doesn't require D3D12 to do anything and that D2D will set up its own command list internally and submit it to the command queue and execute it in D2D's EndDraw method. I can't find any confirmation about this though.


I've attached another example which I do not understand at all. "D3D12-DirectWrite-DrawsText.zip" is a program that draws text. I was copying code around and suddenly it started rendering. It's so odd though. It only renders after a few frames though. If you change the code to call "Render();" just once it renders a black square. I assume whatever it's doing is very undefined, but it shows that somehow, someway, that D2D and DirectWrite can be made to work with D3D12. I just can't find the right way.


What I want is essentially contained operations.



RenderTextToTexture(); // D2D and DirectWrite have completely finished rendering to a texture

Render(); // Draws a single frame with the texture rendered.


If someone can look at the code I'd appreciate it. I have very little DirectX experience so it's possible I'm doing something silly and unrelated wrong. Or if someone can find someone at Microsoft to look at it and write a real example that would be nice since I'm not sure if what I'm seeing is a bug. I've spent way too long on this.

In Topic: Direct3D 12 documentation is now public

08 May 2015 - 09:14 PM

Is the VS graphics analyzer supposed to work right now? I can run the diagnostics tools and take frame screenshots, but if I try to view the frames it opens the analyzer and then a window displays "Visual Studio Graphics Analyzer has stopped working". Is there any information on when this feature will be available/fixed?


Ah VS RC has a working graphics analyzer. Ooh, I got text to render. I think I figured out my bug finally! Graphics analyzer crashes though if I try to take a picture of the frame. Probably doing something wrong still though. More investigation is needed.