Open devshgraphicsprogramming opened 5 years ago
Also provide a GLSL function to calculate new gl_FragDepth
(without writing to it! just want the number) given a tangent-space difference between the ray-entry-point and the ray-hit-point.
@AnastaZIuk add to stack of "recruitment tasks"
Make the binary search optional (update: I'd rather you not use bsearch) as well as the usage of a quad channel cone-map https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch18.html
Need an irr::ext to cone maps from a bump-map (and warn everyone all the way through about the assumption that tangent space is completely flat). This should be implemented as a compute shader and should be possible to happen together with derivative map computation. It should be able to compute both the quad-channel cone-map and a single-channel cone-map. IMPORTANT Include an alpha testing threshold in the cone-step-map calculation, if alpha below threshold, substitute Relief Map value for -FLT_MAX (the the raytracing correctly skips downward).
It makes sense to compute derivative map and cone-map with the same function parameters as the heightfield-scale has to match. Heightfield-scale parameter should be defined relative to the normalized 0,1 texture coordinates, not texels, to be resolution independent and give the same results (as it is in derivative mapping already).
NOTE: The compute shader that calculates the derivative map, should also calculate the mip-maps as the mip-map filtering for a cone-map could be vastly different from the standard (manipulate shininess even further on account of the height differences). However no further filtering of specular maps should is necessary until #280 is complete.
Derivative map and cone-map should be in separate textures, as during the raytracing the cone-map will be sampled multiple times and we don't want to use more bandwidth than we need to.
Implement as a GLSL function generated from mostly built-in engine includes. Keep the implementation modular enough so we can trace arbitrary rays in tangent space, also provide two version of the tracing function:
Bonus points for implementing silhoutte handling properly http://www.inf.ufrgs.br/~oliveira/pubs_files/Policarpo_Oliveira_RTM_multilayer_I3D2006.pdf This has stuff for handling silhouettes http://www.inf.ufrgs.br/~oliveira/pubs_files/Oliveira_Policarpo_RP-351_Jan_2005.pdf