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!


kalle_h

Member Since 05 May 2012
Offline Last Active Today, 03:06 PM

#5231316 Get height at certain point in a triangle

Posted by kalle_h on 27 May 2015 - 01:04 PM

Why complicate simple bilinear filtering from heightmap with triangles. Even tought triangles are rendering representation it does not have to mean that physics use same representation.

 

Simple way that works for me.

http://pastebin.com/LcwGBbv8




#5230074 Circle embedded in line-- fastest vector to unembed

Posted by kalle_h on 20 May 2015 - 12:04 PM

Square root maps to hardware and its fast. There are tricks to calculate inverse of square root but those might ends up to be slower these days.

 

http://betterexplained.com/articles/understanding-quakes-fast-inverse-square-root/




#5220767 Modern cartoon shading that's not cel shading

Posted by kalle_h on 01 April 2015 - 12:25 PM

Just using physical based shading with exaggerated and interesting materials take you long way.




#5220012 How to implement skeletal animation in 2d game?

Posted by kalle_h on 29 March 2015 - 01:23 PM

Quick google tour hinted that there should be runtimes for Allegro too.(unofficials)

NIH virus is dangerous and you should try to cure it.




#5219452 What are your opinions on DX12/Vulkan/Mantle?

Posted by kalle_h on 26 March 2015 - 03:12 PM

We actually do not need more cores onto CPUs, we need bandwidth D:

But cores are cheap, bandwith is not.




#5218635 Efficient way to check which lights belong to which meshes?

Posted by kalle_h on 23 March 2015 - 04:26 PM

Quicky algorithm that I would try.

 

1. Frustum cull visible lights.

2. Sort lights by radius. 

3. Frustum cull objects but add biggest radius of visible lights for every object.

4. For each visible light loop over object list from pass 3 and do range check. For each face frustum cull objects that are inside the range.




#5218632 Efficient way to check which lights belong to which meshes?

Posted by kalle_h on 23 March 2015 - 04:19 PM

 

Twenty lights and a couple hundred objects? Brute force sphere-sphere testing should be nearly instant in this case. You're doing something wrong there.

I forgot to add, I am doing 6 frustum cullings per light since they are point lights that use shadow cube maps. This is only done for dynamic lights though.

 

But those 6frustum culling passes per light should be very fast bebecause they should only operate for subset of data. Assuming that you do range check before.




#5218304 *solved* Too slow for full resolution, want to improve this SSAO code

Posted by kalle_h on 22 March 2015 - 01:40 PM

Now we just need some screenshots.




#5218226 *solved* Too slow for full resolution, want to improve this SSAO code

Posted by kalle_h on 22 March 2015 - 05:43 AM

GLSL port of SAO is pretty inefficient but its memory bound so ALU ops does not mean much in most case. Sin/Cos are not problem(can be replaced with 2x2 rotation matrix if needed) but the integer math/ integer uv sampling.

 

There is cleaned version of Hardland ssao. http://pastebin.com/WZCsjkrj

 

I set sample count to 16 to match with your testing but I have noticed that you get better quality with something pairless number. Prime numbers are good. I use 17 for ultra and 13 for high.

 

Another SAO version can be found here. https://github.com/bartwronski/CSharpRenderer/blob/master/shaders/ssao.fx

 

ps. Its lot faster to port from hlsl to glsl than optimize the glsl version.




#5218148 *solved* Too slow for full resolution, want to improve this SSAO code

Posted by kalle_h on 21 March 2015 - 03:24 PM

Good results.

For kernel size issues read SAO paper.  http://graphics.cs.williams.edu/papers/SAOHPG12/

Basically the main idea is to use depthbuffer with mipmaps that are generated using rotated grid for subsampling. This make the algorithm performance almost totally independant of kernel radius.

 

You should try more aggressive temporal smoothing for ssao. This way you can get rid of your most expensive component(blurring) and use all computation time for additional samples.

 

If you remove blurring how many samples you need to get stable results? 32? 64?




#5217985 *solved* Too slow for full resolution, want to improve this SSAO code

Posted by kalle_h on 20 March 2015 - 07:10 PM

Try to reduce samples of your full resolution ssao. This will increase high freq noise but this is lot easier to deal than upscaling artifacts with high freq content. You can also try to use half resolution depth buffer as input(with 16bit depth) when still doing full resolution ssao.(current pixel use full res)

Or you can even build mipmap pyramid like this. http://graphics.cs.williams.edu/papers/SAOHPG12/

 

 

In our current game Hardland I have ditched whole spatial blur pass and replaced it with temporal smoothing. It's give better quality and its cheaper but may cause minor amount of ghosting. It's quite similar than this. http://bartwronski.com/2014/04/27/temporal-supersampling-pt-2-ssao-demonstration/

 

Edit: Ao only screenshot.(ignore terrain large scale ao, focus on foliage) https://www.dropbox.com/s/uizy0vwvasumvrv/AoOnly.png?dl=0




#5217665 What are your opinions on DX12/Vulkan/Mantle?

Posted by kalle_h on 19 March 2015 - 10:43 AM

On the other hand, if you have to to a GL/D3D map/unmap operation, that's probably 300 microseconds of driver overhead!

That would only mean 53 map/unmaps per frame on 60fps. Can't be right.




#5216971 Names for a "Death Star"

Posted by kalle_h on 16 March 2015 - 06:10 PM

Iron star.

 

http://en.wikipedia.org/wiki/Iron_star




#5216970 'un-flattening' a 3D array

Posted by kalle_h on 16 March 2015 - 06:07 PM

index = x + y * width + z * width * height

z = index / (width * height)
y = (index - z * (width * height)) / width
x = index - y * width + z * width * height



#5216489 Lighting with deferred rendering

Posted by kalle_h on 14 March 2015 - 02:46 PM

First you populate gbuffer. Separate framebuffers for diffuse, normals and maybe roughness + specular intensity.

Then you render light passes that read from gbuffer and write to backbuffer.

 

Over bright images can be battled with hdr rendering but first make the initial system work.






PARTNERS