Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Apr 2012
Offline Last Active Mar 23 2016 01:25 AM

Posts I've Made

In Topic: Stop 3D objects moving when windows is resized [XNA/WinForms/C#]

25 February 2015 - 05:21 AM

I remember when I used to work on XNA that I also gave up with trying to have dynamic resizing. I've sinced moved onto SharpDX which has allowed me to customize resizing the way I want. I recommend learning the raw API's once you feel comfortable enough with XNA, they're not as scary to use as it seems.

In Topic: Constant buffer or not?

23 February 2015 - 02:52 AM

Thanks Hodgman, considering the limited amounts of Matrix multiplation for 2D spriting I think that may be the best solution.

In Topic: "bind slots vs. registers" concern

01 February 2015 - 06:05 AM

I have always found that compiling the shader with FXC.exe is a useful learning tool.  This command line tool requires you to tell it the file and the function you are compiling, along with the shader type and target model.  You can create an html output file, which gives you lots of information about the shader, its input resources, and the shader's input and output signatures.


That will tell you about the shader, but you can also programmatically access the same data through the reflection interfaces.  There is examples in my engine (linked in my signature below) about how to use the reflection interface, so feel free to take a look and borrow code as needed.


I just wanted to say thanks for mentioning this! I didn't know such a feature existed within the fxc tool. I had so many questions about the output of shaders and I just answered them all myself (was going to write a long question on gamedev.net).


Goes to show it's sometimes quicker testing things out yourself than asking.


Edit: For others who don't know what I am talking about, it's the /Fc command in fxc.exe.

In Topic: Direct3D11 without a Depth/Stencil (back)buffer

29 January 2015 - 08:04 AM

Thanks for the reply.


I think the default value for the DepthStencilState (even when it's initially null) is to have DepthEnable enabled https://msdn.microsoft.com/en-us/library/windows/desktop/ff476110%28v=vs.85%29.aspx, so maybe I should just create a state object for that and set it to false there too just incase.

In Topic: Ways to render a massive amount of sprites.

29 January 2015 - 07:07 AM

Its simple, try and minimize Draw calls, constant buffer updates and vertex/index buffer submissions. I feel like most 2D games are reliant on CPU's these days however since almost every frame you'll need to wait for the CPU to order some sprites for the GPU to draw.


I also feel like for a basic 2D game there only needs to be one constant buffer with one item inside it - which is the Matrix transformation used to render the quad (this would be inside the vertex buffer). The pixel shader needs the texture2d shader resource used for texturing the quads.


Edit: Also try to minimize how often you change the pixel shader's texture2d shader resource - i.e. create a texture alas and/or try to draw quads that use the same texture together.