Derpius / VisTrace

Garry's Mod binary module for tracing meshes at high speed on the CPU (and much more)
https://derpius.github.io/VisTrace
MIT License
27 stars 1 forks source link

[feature] Material toolgun #52

Closed Derpius closed 2 years ago

Derpius commented 2 years ago

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

Derpius commented 2 years ago

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

Derpius commented 2 years ago

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

Derpius commented 2 years ago

Added approximated image based lighting with roughness image image image

Derpius commented 2 years ago

Couple things left to do:

Derpius commented 2 years ago

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

Derpius commented 2 years ago

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)

d96b964fbc483fc91ea1fde33b5852f52417f37c

Before: image

After: image