chunky-dev / chunky

A path tracer to create realistic images of your Minecraft worlds.
https://chunky-dev.github.io/docs
GNU General Public License v3.0
637 stars 76 forks source link

Better BTDF #1668

Open ConsueTerra opened 8 months ago

ConsueTerra commented 8 months ago

This pr is the first of a series to implement a better BTDF in chunky. This pr adds a linear lerping like in specular reflections in other to enable glossy reflections, a new material parameter called trasmissionRoughness which is set independently from roughness the UI parameter is Transmission smoothness. Fixes Issue #1591

Before (1 smoothness,1 transmission smoothness) After (1 smoothness,0.8 transmission smoothness)
image image

A scene example 80k SSP, the white glass has a transmission smoothness of 1, red glass of 0.75, blue glass of 0.5, notice the increase spread of the caustics (sun sampling is OFF) image

This pr is a draft, there are 2 pending issues:

ConsueTerra commented 8 months ago

I have included diffuse transmission as well,

Before ) After (0.3 transmission)
image image

This is only ray depth 5 so the effect is suble but you can see softer shadows on the leaves (some of the light bleeds to the back) and the shadows have a green tint. Even with a high Ray depth it was near impossible to light these forests scenes properly. The new parameter is additionalTransmission.0.3 is a good value for allowing back facing light without taking to much brightness from the front. Currently diffusion is split b/w refection and transmission, this is energy conserving on some block models but not others, probably due to how intersections currently work.

A look at ray depth 20, 72 samples (1600 by 1600) forest-72