magicien / GLTFSceneKit

glTF loader for SceneKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lightingEnvironment rendering problem

magicien opened this issue · comments

I realized when I use SCNScene.lightingEnvironment, some models are rendered wrongly.
Fortunately, I can get the full shader source with Metal debugger. Let's check what is wrong.

shader.metal.txt

waterbottle
barramundifish
boombox

Its the occlusion maps, for some reason its getting set to 5000

image

but if we set it back down to 1 its looking good again.

image

Genius!
I thought the default value of ambientOcclusion.intensity was 1000.
I fixed the calculation and it looks beautiful now.
Thank you so much!

waterbottle_fixed
barramundifish_fixed
boombox_fixed