Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 15 Sep 2003
Offline Last Active Dec 20 2014 09:48 PM

Topics I've Started

Radiance Question

13 December 2014 - 09:42 PM

I'm reading about the radiometry terms and have come to radiance.  The books mention that radiance does not change with distance.  I think I get why.  But what I don't get is if we are working with radiance, which supposedly does not change with distance, then why do we do distance attentuation in our lighting shaders?   




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)?