Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 May 2012
Offline Last Active Today, 04:53 AM

#5187513 Should I try to optimise the World matrix build like this?

Posted by kalle_h on 16 October 2014 - 05:03 PM

What Mike Acton would say.

#5184432 Implementing SAO

Posted by kalle_h on 01 October 2014 - 04:29 PM

Try to lower intensity and tune up the fallof function to be bit less harsh. Try to raise radius a bit too. I have implemented SAO with great result so algorithm should be good.

#5182832 Nvidia GI Hardware Support

Posted by kalle_h on 25 September 2014 - 02:28 AM


I'm confused. Nvidia supports GL_ARB_sparse_texture with both Kepler and Fermi, so why is this a Maxwell only feature?

They're probably using GL_EXT_sparse_texture2.


Who would actually use this middleware though? If VXGI only supports the very latest nVidia GPUs, then you still need to implement your own GI system yourself to support older nVidia cards, and ATI cards, and Intel users... Bit of a poisoned chalice really.



I did understand that it does work on other hardware but only with a lot lower speed.(3X without new hardware features)

#5181592 Deferred omni/point light issues

Posted by kalle_h on 19 September 2014 - 12:46 PM

Light dir should be calculated at pixel shader. From pixel calculated position towards light center(this is contant so calculate it at cpu)

#5174378 Convert view space to world space issues

Posted by kalle_h on 18 August 2014 - 01:10 AM

http://www.nigels.com/glt/doc/matrix4_8cpp-source.html There are some code how to do it. It's not veryt efficient to inverse matrix per pixel but if its only way then you maybe just need to do it.

#5172601 Rendering blended stuff before skybox?

Posted by kalle_h on 10 August 2014 - 08:25 AM

Opaque geometry should be drawed from front to back and before any transparent objects. Sky box is opaque object so it has to be drawed before blended stuff.

#5165863 optymizations by self modifying code

Posted by kalle_h on 09 July 2014 - 12:08 PM

Executable memory is one of those things that Apple have decided is "far too dangerous for developers to have".


So any attempt at self modifying code on IOS is doomed to failure.


You can trick windows and get some nice executable memory, I used it for years as a way of injecting my own code into third party games.


However in the general case if you think you need self modifying code, you have probably got the algorithm wrong smile.png


Even with the best designed bits of self modding, you save nanoseconds (they may be important nanoseconds, if such a beast exists) whereas a change in the algorithm often saves milliseconds.

JIT compilers tend to disagree.

#5165226 How to create AABB tree for dynamic mesh?

Posted by kalle_h on 07 July 2014 - 05:03 AM

Just approximate every character bone with sphere(our couple) and do bruteforce test.


#5163875 Execute shader depending on what's visible on screen

Posted by kalle_h on 30 June 2014 - 12:06 PM


it might help to describe the problem from a design perspective too. Is this something to do with radiation or anomaly zones? You want the players screen to undergo an effect when they stare into an anomaly, etc?

Also, as well as post-processing shaders, can you place custom meshes into the world and put custom materials/shaders on them? Maybe there's a solution down this path as well?


I have made several post-processing effects that affect only certain areas on the game level map while leaving others untouched. One prominent example would be reflective surfaces, say the tile floor in some lab casting diffuse light reflections. The reflection stuff is made by a post-process shader. Implementation details of that post-process are off-topic here.


As I have no means to control which areas on the map have a reflective floor by material or color or any other 2D or 3D property I need to manually define arrays of coordinate set for those areas where the post-process should be executed. Then, my CPU-side script should check whether what the player currently sees is "mostly" part of such a defined coordinate set (e.g. tile floor to be rendered reflective), and if so, set some engine variable that will be read by the GPU-side shader to enable the according post-process. It's no an exact match then because the percentage of screen coverage will decide whether to enable a specific shader effect, but it's a approximative approach.



Do you have access for any gbuffer data?

#5163604 Screen-Space Subsurface Scattering artifacts (help)

Posted by kalle_h on 29 June 2014 - 06:37 AM

But its inside the loop that uses the calculated offset tex coords, how would I do that in a pre pass ?


Premultiply masked areas to zero so bright stuff don't bleed.

#5158776 Screenspace Shadow Mapping Help!?

Posted by kalle_h on 06 June 2014 - 02:31 PM

Would you be willing to share how you did it? Or even work with Telanor directly? PM Him on the forum if you would please and maybe we can hook something up. Thank you very much

I can give the code but I can't give any support for while. My weddings tomorrow and at summer vacation for couple weeks for now.

float3 screenSpacePos = float3(input.position.xy  * u_invFrameBufferSize, clipSpaceZ);
float3 rayPos = u_lightPositionProjected; // xy in texture space. z in clip space
float3 rayDir = screenSpacePos - rayPos;
int samples = 22;                                              
rayDir /= samples;
float jitter = -0.5 * ((screenUV.x+screenUV.y) & 1); // help with aliasing
rayPos += rayDir * jitter;
float occluded = 0;                                    
float2 treshold = float2(0.0002, 0.003); // tune
for (int i = 0; i < samples; i++)
        rayPos += rayDir;
        float4 d = 1.0 - rcp(rayPos.z) * u_texture0.Gather(samData, rayPos.xy); // texture is downsampled 16-bit depth buffer 
        occluded += dot(step(treshold.x, d), step(d, treshold.y));
light *= pow(0.93, occluded); // exponential fallof

Occlusion test should work better if I would use viewSpace relative test instead of clipspace relative.

#5158754 Screenspace Shadow Mapping Help!?

Posted by kalle_h on 06 June 2014 - 12:31 PM

We also have fully dynamic scenes and lots of pointlights but their shadows are not that important so we use screenspace raytracing. It's really simple to implement and its scale quite well. Quality is lot better than having no shadow solution for all lights. I should try to combine this with some screen space directional oclusion.

#5156214 Screen-space shadowing

Posted by kalle_h on 27 May 2014 - 01:21 AM

That's awesome biggrin.png

Is all the shadowing done in screen-space, or are there traditional techniques used as well?


Typical cascades shadow map are maybe showing from moon light but I can't be sure because those point lights are so much brighter than anything else. There is also temporallly smoothed SAO variation with multi bounce lighting that contributes fully shadowed areas quite well. https://www.dropbox.com/s/x7tvd8bags5x3pj/GI.png

#5155977 Screen-space shadowing

Posted by kalle_h on 26 May 2014 - 01:29 AM

We are using screenspace shadow tracing. Its quite cheap. I use 24 x gather4 samples from quarter resolution 16bit depth buffer. Then I just count intersecting samples and use expontential shadow term. pow(shadowTerm, intersectedSamples)

Its work really well actually.


#5154397 Screenshot of your biggest success/ tech demo

Posted by kalle_h on 18 May 2014 - 05:31 AM


Screenshot of our upcoming game Hardland. Main focus in this screenshot is sprite based bokeh.