Code Monkey home page Code Monkey logo

Comments (8)

javagl avatar javagl commented on May 18, 2024 2

@cx20 The spec says that the the material in this case should be one where all values have their default values, as of https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#default-material

So in that sense, the current screenshot (showing the dark gray triangle) could be considered to be "wrong", and the white one is more likely to be "correct" .... assuming that there is some sort of light.


(Well, the gray one is still correct, if there only is a gray light ;-) Technically, every glTF renderer that shows a completely black screen for every model (at least, without emissive info) is a perfectly specification-compliant glTF renderer. As long as there are no lights, nothing is visible. So it's really hard to say what's "right" and "wrong" here...)


(Coincidentally, one of the last changes in the 2.0 branch of JglTF was related exactly to that - namely, setting the proper "default material values". But it is still no complete. It will, in fact, be necessary to create a "Shader Generator", that generates the whole shader code based on the glTF material. Maybe I'll find some inspiration in https://github.com/AnalyticalGraphicsInc/gltf-pipeline/blob/master/lib/processModelMaterialsCommon.js , but this is also still incomplete...)

from minimal-gltf-loader.

shrekshao avatar shrekshao commented on May 18, 2024 1

@cx20 Great thanks for your constant help. I've fixed this at the latest HEAD, together with draw without instances. There's still an issue with animated triangle seems to be a known issue of the old loading code.
As the loader features grow, the temp renderer becomes really ugly (and actually feature incomplete). I'm going to use this loader in one of my other project so that hopefully I can come back with a comparatively more robust and neat renderer (and also refactor some old code, and support for PBR). Might take some time to make the testing list all green. I hope that won't last for too long.

from minimal-gltf-loader.

cx20 avatar cx20 commented on May 18, 2024

@shrekshao Thank you for fixing. The geometry is correct, but the color seems to be different than expected. Perhaps it is correct to gray as the default value.

Minimal glTF Loader + Triangle.gltf result:
image

Expected result:
image

from minimal-gltf-loader.

shrekshao avatar shrekshao commented on May 18, 2024

@cx20 Hmm it seems to me the default material should be a plain white: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#reference-material, https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#reference-pbrmetallicroughness
Is it because I didn't implement PBR?

from minimal-gltf-loader.

cx20 avatar cx20 commented on May 18, 2024

@shrekshao I'm sorry. Perhaps the specifications may be glTF 1.0 specifications.
https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material

using a default material with 50% gray emissive color. 

@javagl Do you know what color Triangle.gltf (https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Triangle) is displayed correctly?

from minimal-gltf-loader.

cx20 avatar cx20 commented on May 18, 2024

@javagl I am a little surprised that white is correct. I thought that it was correct because the sample image and the execution results of other libraries were gray. I would like to reconfirm the settings of the lights of other library samples.

from minimal-gltf-loader.

javagl avatar javagl commented on May 18, 2024

@cx20 Some of the other renderers already have "proper PBR" - particularly, with environment-based lighting. You can see the apparent color change depending on the viewing angle, particularly in Three.js.

But indeed, it's less visible in other viewers, and the differences are considerable.

There, the crucial questions are 1. which sort of lights they are using and 2. whether they are already using the default material of glTF 2.0. (For example, Cesium might still have the default material of 1.0 - but of course, without looking at the code, this is only a wild guess).

from minimal-gltf-loader.

cx20 avatar cx20 commented on May 18, 2024

Since the triangle is already displayed, this Issue is closed.
As for writing, my understanding is insufficient, so if I find that it is a problem, I would like to report Issue again.

from minimal-gltf-loader.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.