question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pbrSpecularGlossiness sample?

See original GitHub issue

Hi, is there maybe an example available how to use pbrSpecularGlossiness shaders? For example to create ‘best practice’ json https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness#best-practices

{
    "materials": [
        {
            "name": "gold",
            "pbrMetallicRoughness": {
                "baseColorfactor": [ 1.0, 0.766, 0.336, 1.0 ],
                "roughnessFactor": 0.1
            },
            "extensions": {
                "KHR_materials_pbrSpecularGlossiness": {
                    "diffuseFactor": [ 0.0, 0.0, 0.0, 1.0 ],
                    "specularFactor": [ 1.0, 0.766, 0.336 ],
                    "glossinessFactor": 0.9
                }
            }
        }
    ]
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
vpenadescommented, May 25, 2020

If you’re using the Toolkit’s MaterialBuilder framework, you can set a fallback material.

So let’s say you want to create a material that has a main “specular glossiness” material, and a “metallic roughness” fallback material that will be used if specular glossiness is not available.

var fallback = new Materials.MaterialBuilder("material1 fallback")
                .WithMetallicRoughnessShader();

var primary = new Materials.MaterialBuilder("material1 primary")
                .WithSpecularGlossinessShader()
                .WithFallback(fallback) // sets "fallback" material for this material.

And then you use the “primary” material with MeshBuilders.

There’s also a unit test here.

1reaction
vpenadescommented, May 28, 2020

I’ve commited some improvements and API changes… the whole MaterialBuilder framework was more buggy than I expected, so I had to rewrite some code. I’m still not 100% confident, so I’ll keep writing more unit tests for a few days before uploading new packages.

In the meantime, if you could use the latest changes directly, it could help me identify any other bug or use case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The PBR Guide - Part 2
Just as with metal/roughness, the specular/glossiness workflow is defined through a set of maps which are fed as textures to a sampler in...
Read more >
KHR_materials_pbrSpecularGlo...
The PBR specular-glossiness materials are defined by adding the KHR_materials_pbrSpecularGlossiness extension to any glTF material. For example ...
Read more >
Specular-Glossiness Materials - HitFilm Legacy - 2021.2
The Specular-Glossiness workflow is system of physically-based rendering (PBR) which defines materials using a base color and their specular and reflective.
Read more >
Is it possible to create specular glossiness workflow PBR ...
I'm trying to replicate fully GLTF compatible materials in NodeMaterial, including not just the base gltf spec but also the most common GLTF ......
Read more >
DONTNOD specular and glossiness chart - Sébastien Lagarde
The chart is divide in two parts. The upper is for specular color of material, the second is used for glossiness (roughness on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found