Jump to content

PBR Setup


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

I wonder what does Ultra need for a PBR material.  Diffuse, Normal, and is it roughness and metalness?  Can the later two be combined into one texture (R&G channels?)

I decided to do some tests with the default normal and tangents and don't know what's happening here.  I haven't assigned a material to the model.  I thought it might have to do with the fact I haven't given it any textures to work with.

mesh = CreateMesh(MESH_TRIANGLES, vertices, indices);
mesh->UpdateNormals();
//mesh->UpdateTangents();//This makes no difference to the result
model->Clear();
model->AddMesh(mesh);
model->UpdateBounds();
//model->SetMaterial(mat);

Spots.thumb.png.d7d2d6d6478f0257ff20ac0bd1297dd7.png

Link to comment
Share on other sites

  • Solution

PBR is in use by default. The default roughness is 1.0 (maximum) and the default metalness is 0.0 (minimum).

If a metal/roughness texture is in use it will be used to multiply the metal / roughness values. Metal/roughness textures are the same as in the glTF format, with the green channel storing roughness and the blue channel storing metallic:
https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#metallic-roughness-material

Quote

The textures for metalness and roughness properties are packed together in a single texture called metallicRoughnessTexture. Its green channel contains roughness values and its blue channel contains metalness values.

Finally, PBR lighting relies a lot on reflections. To get the correct look you must apply a diffuse and specular environment map to the world:
https://www.ultraengine.com/learn/World_SetEnvironmentMap?lang=cpp

The specular texture can also be used as the world background, or for a more abstract look you can use the diffuse texture as the background, as I did here:
https://www.ultraengine.com/community/gallery/image/2548-asset-editor-wip/

These textures can be generated from an HDRI image with the Khronos IBL sampler tool, which is included in the Tools folder. This outputs KTX2 files, which can be loaded with the KTX2 plugin, or converted to DDS format with this code:
https://www.ultraengine.com/community/blogs/entry/2780-building-a-single-file-4k-hdr-skybox-with-bc6-compression/?tab=comments#comment-14747

There are some ready-made environment maps in DDS format here you can also use:
https://github.com/UltraEngine/Assets/tree/main/Materials/Environment

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...