koeleck / grapro

0 stars 0 forks source link

grapro

voxel fragment buffer:
    uint pos3col1
    uint col2em2
    uint em1norm3
    use (un)packUnorm4x8

octree node buffer:
    vec4 col.xyz_em.x (vec4 because of atomic add)
    vec4 em.yz_norm.xy
    float norm.z
    uint pos
    uint counter (to count how many fragments in a leaf)
    uint padding

1) voxelization:
    save all conservative fragments in voxel fragment buffer
2)
    a) node alloc
    b) node flag
        if leaf:
            atomicAdd color, emissive, normal, counter
    c) injectLightingInformation:
        walk over all leafs and compute radiance (walk over all lights) ("shadowmapping to octree"):
            27 mal: speicher in 3d textur in 3x3 texels

3) cone tracing
    a) render from camera
    b) at every pixel:
        - direct lighting: from gbuffer
        - indirect lighting (diffuse): get voxel position; setup cone grid; walk along cones and accumulate color from walked through voxels (interpolate with 3d texture brick)
        - indirect lighting (specular): reflect view dir at normal; walk cone along that line; see above