guycalledfrank / bakery-issues

Bug tracker for Bakery
4 stars 0 forks source link

URPVolumeSpecGraph no reflection #38

Closed laurentopia closed 3 years ago

laurentopia commented 3 years ago

image with these settings image this is UTP/lit image

laurentopia commented 3 years ago

with the same parameter of metallicity and smoothness so the question is how do i get urpvolumspec to have the same reflectance?

laurentopia commented 3 years ago

and on second look it appears that bakeruurpvolumspec doesn't grab the reflection from the refprobe but instead grabs the sky map

laurentopia commented 3 years ago

proof: reflection probe intensity = 5 image

reflectionprobe intensity = 1.5 image

= same

so whatever bakedurpvolumespec is reflecting ain't the refprobe

guycalledfrank commented 3 years ago

URP is quite horrible when it comes to extending it.

Anyway, the problem seems to happen because of my hacky way of replacing built-in GI which involves setting Occlusion to 0 (essentially multiplying built-in GI by zero). Turns out, it also multiplies reflection probes by zero.

As there is no custom GI input in the PBR Graph, I added reflection probe sampling with PBR weighting to the graph. Please try this version: https://drive.google.com/file/d/14gKWpEl_adF0euOMHLbGBcF7Fqm310Jb/view?usp=sharing

laurentopia commented 3 years ago

Thanks!

I see you now feed emission with reflection probe. I think there is a problem with the math as suddenly the brightness of emission objects is much much less, I need to 3x its value and then the hue changes.

By the way, does the shader compiler or execution skip chunks of shader code if the values are zeroed out. For example if you don't connect anything to transparency, AO or metal etc...

guycalledfrank commented 3 years ago

Comparing to standard URP Lit shader, my graphs may have a different way of scaling the emission (just a linear multiplier). Not sure about hue, there shouldn't be any difference.

I really hope it skips built-in GI/refprobes as occlusion=0 is a constant compiled into the shader.

laurentopia commented 3 years ago

It looks like it skips a lot image a compiled PBR with occlusion = 0 is 2.9MB same with occlusion=1 is 3.2MB

guycalledfrank commented 3 years ago

That sounds good! Shouldn't calculate the reflection twice then.