Documentation or Example on Rendering Procedural Mesh
sesteel opened this issue · 6 comments
I've struggled with getting a procedural model to render correctly. I am building a simple heightmap which displays correctly in the default pipeline; however, after modifying the materials when adding it to a scene it renders black.
I have several models in the same scene rendering on the same SceneManager render call with the same lights. Is there a particular texture that must be present for lighting to work correctly? I just want to make sure I am not spinning my wheels in the wrong area.
@sesteel Sorry for the delay. No special texture is necessary to have lighting working correctly. The minimal setup (if i remember correctly) is to have a BaseColor (see PBRColorAttribute.createBaseColorFactor) for your material and normals for your mesh.
@yuripourre as said in my previous comment, material should have a baseColorFactor (PBRColorAttribute.createBaseColorFactor). ColorAttribute.diffuse is not compatible with PBR shader.
@mgsx-dev thank you, I will do some testing later today.
@yuripourre @sesteel i added a minimal runnable example of procedural model and material here
@mgsx-dev PBRColorAttribute.createBaseColorFactor
did the trick, I was trying to use create diffuse instead.
Thank you so much for this example, it is very helpful!