Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 17 Apr 2004
Offline Last Active Today, 01:23 AM

#5240064 Making my model class Vertex Independent

Posted by BornToCode on 13 July 2015 - 07:16 AM

Explicit Or any attributes that your vertex support have. Then when you create them you use a stride that matches all the Attributes that your vertex have. For example if you only have postion and normal. You can do something like Model.AttributeType = POSITION|NORMAL. and when you create your memory to hold the vertices you can look at the attributes you have in AttributeType and create a stride that matches that type. For example you know position type would 12 bytes and Normal is also 12 bytes as well in that case your stride would be 24 bytes.

#5238198 Update a specific region of the render target?

Posted by BornToCode on 03 July 2015 - 09:43 AM

If you look at the graphics pipeline  you will notice that the PixelShader executes after the rasterize state. So if you set the Scissor rect,it will not execute the pixel shader on any of those pixels that falls out of that rect region.

#5222690 2d Picking with overlapping, transparent images

Posted by BornToCode on 11 April 2015 - 09:04 PM

Another faster way you can do it is that as you project the point and checking if a point is withing an object bound. Just keep track of the smallest value. Then once you are done you can map that smallest value to a map. Kind of like map<int,object>. I hope this make sense to you otherwise I can post some sample code to show you what I mean.

#5222689 2d Picking with overlapping, transparent images

Posted by BornToCode on 11 April 2015 - 09:02 PM

you create a collision map that map whether a point is part of an object or not by first projecting the point on each plane of the objects that you are interested in. Then when you are done you can do distance check and grab the one with the smallest Value.

#5161706 Getting perspective Frustum in world coordinates

Posted by BornToCode on 20 June 2014 - 07:33 AM

Why don't you extract the 6 planes after you multiply world by projection. That would give you the enclosed frustum in world space.

#5160403 Creating Camera Bounding Frustum From View and Projection Matrix

Posted by BornToCode on 13 June 2014 - 06:59 PM

You just need to multiply the ViewMatrix*Projection Matrix. Then you need to extra the 6 planes that makes up the frustum.


//This is Column Major matrix.

//If you have row based then you would flip the multiplication order.

Matrix4x4 ViewProjection = ProjectionMatrix*ViewMatrix;
    Plane& right = GetPlaneRight();

    Plane& left = GetPlaneLeft();

    Plane& top = GetPlaneTop();

    Plane& bottom = GetPlaneBottom();

    Plane& front = GetPlaneFront();

    Plane& back = GetPlaneBack();

#5153593 Vertex buffers in DirectX 11

Posted by BornToCode on 14 May 2014 - 10:18 AM

Why don't you create an orthographic matrix using the screen resolution for your width and height. That way you can specify your coordinate directly in pixel coordinate.

#5153592 clear only partial bits of stencil buffer

Posted by BornToCode on 14 May 2014 - 10:16 AM

The entire stencil must be cleared at once. you cannot just clear a portion of it.

#5151014 Per-pixel displacement mapping GLSL

Posted by BornToCode on 02 May 2014 - 05:09 PM

 try flipping the binormal and see if it has any effects.

#5108896 DirectX11 Swap Chain Format

Posted by BornToCode on 13 November 2013 - 12:10 AM


So what about vista or windows 7 with directx 10/11 where flip sequential might not be available or using say discard as the presentation model?

It will use an additional BitBlit() to copy the DX surface to an intermediate DWM surface, which is slower. But same principal holds - if the swap-chain format matches the screen-format, this operation will be faster. When using the BitBlit mode, you also have more options for swap-chain formats.


This is not completely true for windows 7. As long your backbuffer matches your front buffer and you have your swap chain set to full screen. It will not bitblt, but swap the backbuffer with the front. The only time it bitblt is when the swapchain is in window mode or when the swap chain back buffer does not match the front buffer width/heigh and format.

#5108407 Fullscreen Direct3D 11 multi device (gpu), multi swap chain per device rendering

Posted by BornToCode on 10 November 2013 - 11:41 PM

One way you can handle is to called ChangeDisplayModeSettingEx to change the monitor screen resolution. Then create a bordeless window that is the same size that you have you display setting set to. This will simulate exactly what directx does when you go fullscreen. At my job we have to handle 4 monitors in full screen and that is how i did it.

#5099647 interpolating scalar instead of vector

Posted by BornToCode on 08 October 2013 - 11:54 AM

If you go down that route then it will interpolate across vertices instead of pixels. That basically means all the pixels across vertex bounds will have the same value.

#5098118 Improving Graphics Scene

Posted by BornToCode on 01 October 2013 - 01:11 PM

There are alot of things that can be done in order to increase perfomance. The beast optimization is not draw at all :). What i basically mean by that the less you draw the better. A way to handle that is to use a Scene partition algorithm, and depending on the type of game there are many out there you can choose from. Another thing you can look into is LOD(Level of detail), objects closer to the camera are drawned at full detail while things in the distance are drawned with lower amount of details. The same concept can be applied to textures in the case of mipmapping. That is just some of the few things you can do. Also make sure you use the correct data structure for what you are trying to do.

Hope that kind of give you an idea. Happy Coding :)

#5079680 API Wars horror - Will it matter?

Posted by BornToCode on 22 July 2013 - 04:06 PM

Most of the api are the same but they do have some difference for example there is no such thing as Pixel Buffer objects in DirectX. Just wanted to throw my two cent in there. But at the end of the day if you want to write GL api that looks very similar to DirectX11 it is not impossible. As this is something i am currently doing right now.

#5076025 How to make a map editor with cubes

Posted by BornToCode on 07 July 2013 - 09:21 PM

Build the editor into the engine, using the same rendering code for gameplay and editing, as well as the code that loads/saves maps.

Do not build the editor into the engine, Use the engine as the back end for the editor.