KhronosGroup / glTF-Sample-Assets

To store all models and other assets related to glTF
257 stars 30 forks source link

Sponza model has smooth normals in the wrong places #50

Open HugoPeters1024 opened 1 year ago

HugoPeters1024 commented 1 year ago

This is what the normal map looks like when using dynamically calculated triangle normals (i.e. flat shaded). (Unfortunately this is in sRGB and tone mapped so the colors are a bit off):

image

However when interpolating the vertex models that are read from the file we can see that the drapes are smooth shaded (which is great), but so is the top of the pillar (see the blue and yellow diagonal stripes:

image

Another way of seeing this is by only showing normals that have their y component above some threshold (I believe it's ~0.98 here):

image

I hope it's clear that those normals are not how there are supposed to be. The side effect can be observed in this render for my pathtracer where a black spot occurs because ray samples that do not satisfy dot(outDir, surfaceNormal) > 0 are discarded:

image

The solution is to not share the vertex normals in some geometries. My only experience with tools like blender is using it as a file converter by importing and exporting as is so I was not able to fix it myself. Although I'm very motivated to help out in anyway possible.

Do note that this isssue occurs in multiple places, so far the complete list I've found is:

DRx3D commented 7 months ago

Transferring issue to Sample Assets so it can be dealt with there.