Derpius/VisTrace

[feature] Material toolgun

Closed this issue · 6 comments

Already working on this, here's some images so far
image
image
image

Ambient lighting with a uniform colour
Makes it somewhat usable for rendering things like metals and glass, but really needs image based lighting.

Currently it caches a few thousand samples at intervals across the dot product of the incident direction and surface normal for the entire BSDF, however im gonna implement specific lobe weights then approximate reflection and refraction

image

Implemented active lobes back into the BSDF, meaning I can cache diffuse reflection, specular reflection, and specular transmission separately, then use those weights to multiply a HDRI colour, sampling the MIP based on roughness

Added approximated image based lighting with roughness
image
image
image

Couple things left to do:

  • Replace equirectangular envmap with octahedral to avoid artefacts from mipmapping
  • Store the distribution of scattered directions around the specular reflection/refraction dir when indirect caching to select a physically accurate mip level (might not do this if octahedral looks good enough as is with a mipmap derived from roughness)

Continuing to have issues with mipmapping artefacts, along with the size of the envmaps being large compared to the existing size of the addon

Biting the bullet and implementing seamless cubemap filtering into VTFParser so I can just piggyback off of the existing cubemap library in GMod

Used an ancient AMD tool for mipmapping cubemaps seamlessly, and another ancient Valve tool to build a VTF by hand.
Seams are only really visible at medium to high roughness values now.
Some future work would be processing more cubemaps from various source games and providing a material selection box in the tool's panel to choose between them (right now the filtered gallery002 is in vistrace/material_preview ready to add others)

d96b964

Before:
image

After:
image