Comments (8)
@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.
@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.
@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:
from minimal-gltf-loader.
@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.
@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.
@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.
@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.
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)
- The light of the lantern.gltf does not light HOT 5
- 请教关于 skins 的疑问 HOT 6
- LUT need CLAMP_TO_EDGE? HOT 4
- Color of BoxVertexColors.gltf is not displayed HOT 1
- [Request] Synchronous version of loading HOT 1
- NormalTangentMirrorTest.gltf does not appear as expected HOT 2
- FlightHelmet.gltf goggles are opacity HOT 1
- AlphaBlendModeTest.gltf does not display as expected
- Fix secular environment map with a series of filtered levels corresponds to different roughness
- The texture of Duck.gltf is not loaded HOT 6
- Error loading when loading models other than BrainStem HOT 1
- Virtual City looks like a white dome HOT 4
- TextureSettingsTest double-sided test failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minimal-gltf-loader.