Comments (3)
@javagl thanks for all the research. Is this now duplicate with KhronosGroup/glTF#576? Should we consolidate these issues?
from gltf-sample-models.
They are related, at least.
This issue only refers to the fact that a technique that eventually refers to a semi-opaque PNG does not contain the GL_BLEND
state - but I think that it has to contain this, in order to be rendered properly (and in a previous version, it did contain it).
If it contained the GL_BLEND
state, it would require additional techniques.states.functions
- and this is the relationship to the other issue:
The issue 576 asked about these boxes. They appear in "non-sopisiticated" renderers (that do not use OIT or other fancy stuff). The reason of why the boxes appear is what I currently consider as an error in the glTF file: I think that that blendFuncSeparate
parameters are wrong for transparent materials. At least, using GL_SRC_ALPHA
for the source seems to be intuitively reasonable, and at corresponds to the "typical" setting that is also mentioned in https://www.opengl.org/archives/resources/faq/technical/transparency.htm#blen0020
I wondered about where to report this: Here in glTF-Sample-Models
, or in COLLADA2GLTF
, or the gltf-pipeline
? You added the collada2gltf label at the other issue, and that's certainly a reasonable point to start investigating both issues (although one could first check whether the technique is already wrong or ambiguous in the .DAE input file, and only start digging deeper if not)
EDIT: From a quick glance, at least the technique.states.functions
part seems to be based on the premultipledAlpha
setting ( https://github.com/KhronosGroup/COLLADA2GLTF/blob/master/shaders/commonProfileShaders.cpp#L385 ). I'll have to read more about this. Sorry for bothering you.
from gltf-sample-models.
So I'll have read more about premultiplied alpha (which is ENabled in WebGL by default, but DISabled in OpenGL usually), find the answer to the question of whether the fragment shader should be
gl_FragColor = color;
gl_FragColor = color * u_transparency;
gl_FragColor = vec4(color.rgb * diffuse.a, diffuse.a * u_transparency);
gl_FragColor = vec4(color.rgb * diffuse.a * u_transparency, diffuse.a * u_transparency);
(or whatever) in conjunction with the premultiplied alpha setting, and figure out how to render two assets at the same time, one with premultiplied alpha and one without. But all this is probably only an issue of the renderer implementation, and not of the sample models. Sorry again for the noise caused by my lack of knowledge here.
The texture is still rendered in "opaque black" in cesium, but maybe this is not an issue.
from gltf-sample-models.
Related Issues (20)
- RecursiveSkeletons is not a valid glTF file HOT 2
- Errors in Fox model
- BoxTextured and BoxTexturedNonPowerOfTwo have different texture brightness HOT 8
- Buggy model doesn't follow the 4 bytes alignment requirement of the spec for indices HOT 2
- Blender GLTF fails the gLTF validation HOT 2
- Normal texture TestMap_blur.png does not conform to the glTF 2.0 spec HOT 4
- Please rename default branch from 'master' to 'main' per Khronos policy HOT 3
- Missing license for VertexColorTest HOT 1
- Missing license for BoxVertexColors HOT 1
- Many models missing AO channel HOT 9
- stainedGlassLamp/glTF-JPG-PNG alpha is 0.5 HOT 4
- π₯π₯π₯convert obj 3d model to gltf model on server side HOT 1
- Sponza gltf materials wrong? HOT 1
- It would be great if someone can convert these PBR research models into glTF HOT 5
- Mask / Stencil shader HOT 1
- InterpolationTest oddities HOT 4
- InterpolationTest translation animations loop badly HOT 7
- Iridescence test model? HOT 6
- Anisotropy test model? HOT 6
- Directory structure issues HOT 4
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 gltf-sample-models.