Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 15 Sep 2003
Offline Last Active Oct 29 2014 01:43 PM

Topics I've Started

cbuffer per object or share one cbuffer

08 August 2014 - 12:34 PM

Say you have N static objects with different world transforms.  What method is better:


1. N constant buffers.  Update once, then just change binding per object.  Pro: No Map/Discard overhead for static objects.  Con: Binding overhead.


2. 1 constant buffer.  Map/Discard per object.  Pro: Lower memory presumably (probably not a big deal), only one bind call.  Con: Lots of Map/Discard. 


Googling around people seem to say both methods work out about the same performance wise.  Is there any recommendations from AMD/NVIDIA? 


I looked at http://gamedevs.org/uploads/efficient-buffer-management.pdf


and it says "One for per - object constants (World matrix, dynamic material properties, etc )", but it is not clear is it means exactly one cbuffer, or one cbuffer for every object. 

Supporting Various "Position" formats

08 July 2014 - 09:20 AM

So far my engine always used 32-bit float3 to store position in a vertex.  To integrate with a middleware package, my engine needs to support half position 16-bit float4.  Some parts of my engine need to read the vertex data on the CPU side (say to compute a bounding box).  Does someone have a clean solution for this besides if/else states like:


if(half format)


    cast to half*




    cast to float*




Point density

25 April 2014 - 01:08 PM

I'm starting to read about radiometry and see I need to review some calculus stuff.  I'm trying to understand density at a small length (keeping it 1D for simplicity). 


I've seen density at a point defined by:


lim_{dL->0} deltaM/deltaL


So if I want to know the density at a point x, I might form a small segment about x:


deltaL = (x+h) - x = h


I understand conceptually that deltaM needs to be the average mass in this small segment to get the local density (then in the limit it becomes a point density).  But what is the formula for deltaM?  I feel like it should be something like:


deltaM = m(x+h) - m(x)


but what is m(x)?  At first I started by assuming m(x) is a mass function (it gives me the mass at point x).  But that doesn't make sense.  The difference between two point masses doesn't give me the average mass in the segment. 

dllexport global variable

17 April 2014 - 10:57 AM

This paper gives a way to force high performance rendering when working with optimus driver:




It says to use:


extern "C" {
    _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;


I'm not too familiar with dllexport.  Does this need to be in a header file or just any .cpp file (like app.cpp)?



Hdr Issue with Blending

04 March 2014 - 06:31 PM

Before when I had a LDR system, I blended my foam particles on top of water like so:


F = SrcColor + (1 - SrcColor)*DstColor


This prevented the color from getting too bright since I wanted a white foam effect, not a bright "magic" effect.  This is coming out too dark after tonemapping.  Since the SrcColor is a "fake light" value from the texture, I tried scaling its values up to make it "HDR" but that breaks the (1 - SrcColor) since SrcColor can now be greater than 1.  What is the proper way to do this with HDR and tonemapping?