Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Aug 2012
Offline Last Active Jan 13 2014 09:20 AM

Topics I've Started

Does the tessellator require a 32-bit index buffer for safety reasons?

11 January 2014 - 03:03 PM

Assuming I use DXGI_FORMAT_R16_UINT and not DXGI_FORMAT_R32_UINT for an index buffer format and an unsigned short array for the indices, I get 65536 vertices for a mesh.Now this is good, because it's not like I would ever bind a mesh that huge, but what if I bind a mesh that has 20000 vertices and I use tessellation to generate new vertices, so the new mesh has 4 times more vertices(80000).Will this be an issue with a 16-bit index buffer?

Is automatic state monitoring necessary in a renderer?

09 January 2014 - 04:12 PM

My renderer(based on D3D11) is currently built a lot like the one from the Hieroglyph3 engine.Its something like this:

class Renderer
     static ImmediateContextManager Immediate; //Encapsulates an immediate context, inherits from DeferredContextManager
     static vector<DeferredContextManager> Deferred; //Each one encapsulates a deferred context

    //ID3D11Device functionality - encapsulating methods, like CreateBuffer, CreateTexture, etc.


In the ContextManager each time you set some state it checks if it's been set before and this way it prevents redundant API calls.However that's quite a lot of if checks involved for each object I render.I thought about sorting objects by material type, but that means first I need to sort by shader, then by texture, then by vertex buffer and pretty much anything that would require a state change in the pipeline, and that's a huge amount of sorting each frame and sometimes I still end up with cases where a redundant API calls i made.Basically:

-for automatic state monitoring you get tons of branching each time you render an object
-for sorting you have to perform a huge amount of sorts to make sure everything turns out ok

The performance hits of both these methods get noticed with large amounts of objects on scene.The sorting actually comes up way heavier when I do it(I use Quicksort3), than just using the state monitoring method.Maybe I should make some combination of the two?

Visual Studio DirectX Graphics Debugger - Can I get Rasterizer info?

01 January 2014 - 05:46 PM

I'm generating a mesh from a list of triangles and I can see the mesh properly in the Input Assembler in the Graphics Diagnostics of Visual Studio 2013, I can even see the proper vertex coordinates go trough the vertex shader, however the mesh doesn't get drawn.I think the rasterizer doesn't see it as triangles or something.All my other meshes render properly, however this one doesn't.I'm building it by adding pairs of 3 vertices in a list of triangles.What could be causing it to properly show up in the debugger, but not on the real screen?

Getting shadows in a 2D room offline?

31 December 2013 - 07:20 PM

Hello, I'm writing a program that will generate me a CPU shadow for a 2D room with a light source and any number of polygons.The light is also blocked by the walls.This is the algorithm I've got so far:

1.Sort all polygon vertices by their angle from the light.
2.Generate an array of all lines between 2 vertices.
3.Iterate sorted list and for each polygon check the entire "lines" array to see if the light intersects that and check if the intersection point is closer than the current vertex
4.Each 3 generated vertices make a triangle and add it to the buffer that will be used for the shadow mesh.

Is this the correct way to proceed?

Should I use a shader in this case or not?

27 December 2013 - 10:58 PM

I have a 2D scene of polygons rendered with D3D11 and I have a light source on the screen.I need to compute a shadow map find out how much of the floor is lit(unoccluded by the polygons).The thing is I'm not sure how to do it in 2d, should I just give the polygons a height and then render a cubemap from the light's points of view?And then download shadow map to staging texture and loop trough dark pixels?Can anyone suggest a technique?