Cool VL Viewer forum http://sldev.free.fr/forum/ |
|
PBR base color texture substitution http://sldev.free.fr/forum/viewtopic.php?f=9&t=2436 |
Page 1 of 1 |
Author: | stuffstuffstuff [ 2023-12-12 21:27:57 ] |
Post subject: | PBR base color texture substitution |
As you know, if an object with a PBR material doesn't have a diffuse texture underneath the PBR material, it will look like a piece of wood if the forward renderer is used. Given this, how feasible would it be to implement the following?: 1) Detect when the face of an object has a PBR material 2) Detect when that given face is using the default wood texture 3) If 1 and 2 are true, replace the wood texture with the base color texture from the PBR material. Of course some creators will go out of their way to place textures telling people "update your viewer to PBR" or something like that, but my proposal would at least make the objects that were never textured to begin with look better. |
Author: | Henri Beauchamp [ 2023-12-12 22:10:04 ] |
Post subject: | Re: PBR base color texture substitution |
I already thought about baking a diffuse texture for faces bearing a PBR material and lacking one such texture... This should be doable. Sadly, I do not have the know-how (I know close to nothing or at least too little to OpenGL and shader language): I'm mainly a system programmer (operating systems, system software & utilities, system services), not a game engine or 3D graphics application programmer. But if someone can provide me with OpenGL code and a shader that would combine PBR textures into baked diffuse, I could do the rest of the integration into the viewer code... |
Author: | stuffstuffstuff [ 2023-12-12 22:37:35 ] | |||||||||
Post subject: | Re: PBR base color texture substitution | |||||||||
No worries, I understand! Maybe I will figure out how to do it myself one of these days. |
Author: | Henri Beauchamp [ 2023-12-23 10:30:28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Post subject: | Re: PBR base color texture substitution | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
I finally made an attempt at a very naive hack, consisting in simply switching the renderer to the base color texture for faces with PBR material and without a proper fallback substitution diffuse texture (i.e. with a default plywood or default blank texture set as the diffuse map). EDIT: I also added a mode in which the diffuse (even non-default) texture is force-replaced with the base color texture for faces with a GLTF material, and I perfected the hack so that the base color texture color and transforms are used when it replaces the diffuse texture. The result is not that bad (even though still very far from what a proper diffuse texture baking would allow to achieve). Here is what it gives in Runitai's villa (Rumpus Room 2 sim) on Aditi where many/most PBR objects do lack a diffuse fallback texture (click the pictures for the full size screenshots): PBR rendering mode:
ALM without the hack:
ALM with base color replacing default diffuse:
Forward with base color replacing default diffuse:
ALM with base color always replacing diffuse:
Forward with base color always replacing diffuse:
Note how the GLTF materials of the room walls and ceiling do have a fallback diffuse texture, but use a different color for their PBR material (which, incidentally, and due to a bug of mine in the current viewer version, is wrongly used instead of the diffuse texture color in non-PBR rendering modes: I fixed this bug while implementing the hack). |
Author: | Henri Beauchamp [ 2023-12-30 10:38:12 ] |
Post subject: | Re: PBR base color texture substitution |
Hack implemented in today's release (v1.32.0.4). See the new toggles in the "Advanced" -> "Rendering" -> "Deferred rendering" menu. |
Author: | Henri Beauchamp [ 2024-01-06 09:52:14 ] | |||||||||
Post subject: | Re: PBR base color texture substitution | |||||||||
In today's release (v1.32.0.5) I further refined this hack as follow:
Here is what the new toggles now look like ("Advanced" -> "Rendering" -> "Deferred rendering" menu):
With:
(*) I only saw this happening in Aditi, with early (test) PBR objects, so it could just be the consequence of changed GLTF data during LL's PBR viewer & GLTF server development. Feel free to share your observations in this mode, since I'm still trying to figure out why the Hell these objects vanish... |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |