Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 30 Nov 2010
Offline Last Active Jan 02 2014 11:04 AM

#5059414 Shadow map surface aspect ratio ?

Posted by on 05 May 2013 - 04:07 AM

We allocate power of two texture because it reduce somme padding that may occurs in the memory ( not so true now, specially with big surfaces, but an old habit ). After that, if i allocate some 2048x2048 shadow map surfaces for my pool, it does not mean i have to use all the texels, if i have a distant shadow that should projet on may be 10% of the screen, i may reserve a sub rectangle and scale and bias uvs.


It exist also a lot of technique to improve the texel ratio of the shadow map (warp the projection, refine the shadow frustum around the casters, ...), because as said by hogman, there is no a 1/1 match between a shadow map texel and the frame buffer pixels.

#5059387 Can shaders apply to specific polygons?

Posted by on 05 May 2013 - 02:14 AM

Also, if there is no dependency between two consecutive rendering states ( like write to a render target then read it, depth test on then depth test off, ... ), modern GPU will not wait for the previous one to end before stating the new one, I do not know how many parralel context there is on earlier GPU, but the latest AMD one have 8 :)


Also, changing context is not yet free, so grouping by states the primitives is a good and mandatory practice.

#5049842 Real-Time Tessellation Techniques of Note?

Posted by on 04 April 2013 - 01:07 AM

To me the next standard for characters, weapons and important landmark will be catmull-clark with this solution :


http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf with this update for crease edges http://research.microsoft.com/en-us/um/people/cloop/EG2012.pdf


This is the research and fundation of the opensubdiv initiative from pixar ( open subdiv do not yet have everything done, but the paper is enough to write your own implementation ).

#5048561 Is my frustum culling slow ?

Posted by on 31 March 2013 - 07:34 AM

if a class is declared as align on a 16 byte boundary, the class size will be a multiple of 16 too, because we can write things like MyClass array[N]; and if array[i] is align on 16, then array[i+1] will too.


But if you write MyClass* array = new MyClass[N]; you have no guarante on the memory address return by new, because the operator new do not receive an alignment value. You will need to overload the operator new of MyClass to do some internal memalign, or globaly override the memory allocator to always return address multiple of 16.


And std::array is a C array, so the memory is contigus but do not rely on a memory allocator, so the compiler is able to align the members with the declspec value (as long as the objet storing an std::array<_Plane,6> is not allocate with a bare new )

#5048540 Is my frustum culling slow ?

Posted by on 31 March 2013 - 06:42 AM

class and type sizes are unrelated to instance adresses. If you instanciate a class or type on the stack or in the globals ( data, rodata and bss ), the compiler and linker are aware of the native alignment and can do the work for you if you tag thinkgs correctly, but with memory allocated on the heap you depends on the vendor implementation of the allocator. x64 ABI force a 16 byte aligned address for dynamic allocation, but x86 ABI only require 4 bytes aligned address. Of course, you are free to override the allocator with a custom one.

#5048528 Is my frustum culling slow ?

Posted by on 31 March 2013 - 05:21 AM

There is nothing in the std and the C++ standard that enforce alignment other than the natural alignment of types ( 4 for float ). new and malloc are also anaware of that. use a __declspec(align(16)) on the _Plane declaration and then just instanciate a _Plane vFrustum[6] without std::array. But remember that if you put the array in dynamically allocated memory, you may also fail on the alignment constraint, so you will need to manualy align the root objet memory.

#5046264 Direct3D 11 Deferred Shading Banding

Posted by on 24 March 2013 - 11:46 AM

Banding is normal even with 10bits per components display. The only solution si to apply a dithering pass on the picture. Because floyd steindberg is not really applicable, we use cheaper solution. The most effective one is to add some noise to the color at the tone mapping and HR to LR stage.


So in your pipeline, you add light in the linear space in a 16F render target ( a small float is really enough to add lighting ). Then when moving from linear to gamma from a 16F to RGBA8 you use the formula gammaColor = pow( linearColor + noise1, 1.f/2.2f) + noise2; You can build a small noisy texture (like a 64x64) well create to remove visible pattern, you can also use some dynamic noise to give a movie grain not constant.


By tweaking noise1 and noise2, you will add/remove a small amount of value, enough to let the HR to LR conversion have some pixel moving one up and one down.


After that, the human eye will do the color integration and the banding will disapear magically :)