TheRealMJP / DeferredTexturing

A rendering sample that demonstrates bindless deferred texturing using D3D12
MIT License
529 stars 47 forks source link

No alpha transparency rendering? #19

Closed Koalamana9 closed 2 weeks ago

Koalamana9 commented 2 weeks ago

Why is every transparent object don't render transparency? All the leaves and decals have just black bg. It is important to include this in the demo to demonstrate performance difference between forward and bindless deferred shading. They will most likely have the same performance hit, but overall this is an essential element in any rendering, so it would be fair to take it into account. Is there any simple and quick way to implement this?

TheRealMJP commented 2 weeks ago

I just pushed alpha testing support for the foliage materials in both deferred and forward paths. For the forward path the alpha testing will be done in the depth prepass if it's enabled, otherwise it will be done in the main forward pass.

Koalamana9 commented 2 weeks ago

Nice! But it seems there is a problem with the rendering of the material on the vase and eaves, tested in Marmoset and it shouldn't be black. The chain doesn't use transparency for some reason too 001

TheRealMJP commented 2 weeks ago

Those materials are just mostly black because they're set to be full metallic, and there's no sources of indirect specular in that sample. So you only see the specular reflections from the spot/directional light sources.

I had looked at the chain texture and the alpha channel is all 1.0, so I'm not sure where the opacity information is. If you figure it out or manage to fix to texture, feel free to submit a PR and I'll merge it.

Koalamana9 commented 2 weeks ago

That's true for the vase, it's really all metal. But there's definitely something wrong with the eaves and curtains at the bottom, this is in Marmoset 3 with no environment reflections, just a spotlight, and it has an albedo color there. 001

Koalamana9 commented 2 weeks ago

I tried to fix it but it crashes with an error on startup: DirectX Error: The parameter is incorrect. If I understood this correctly, it could be caused by the original Sponza.fbx being exported with an old FBX SDK/FBX Plugins version 2014.0.1, and when I re-export it from Blender, it uses the new Blender specific version stable FBX IO - 4.1.1 - 5.11.7, and since you are using old Assimp-3.1.1 it causes an error when reading new fbx.