Hi All,
What I observed was that we supply a <white> file to the
Transmissive texture which autoloads an opaque texture which is needed
but while allocating transparent vs opaque surfaces in
void UniversalSurface::renderDepthOnlyHomogeneous
there is a sequence of steps which is as follows
We are trying to call isBlack() method via
==============================
===============
bool UniversalSurface::hasTransmission() const {
return m_material->bsdf()->transmissive().notBlack();
}
=============================================
in UniversalSurface.cpp which calls
=============================================
/** Says nothing about the alpha channel */
inline bool notBlack() const {
return ! isBlack();
}
=============================================
in Component.h, now the isBlack() method depends on a variable m_max which is initialized to Color::nan() and computed on a need-to basis by computeStats() which I think was done for faster loading.
replacing the member variable with a call to the member function fixes this problem as that ensures computeStats() will be called resulting in correct blackness.
Index: G3D-app.lib/include/G3D-app/
Component.h
==============================
==============================
=======
--- G3D-app.lib/include/G3D-app/
Component.h (revision 7048)
+++ G3D-app.lib/include/G3D-app/
Component.h (working copy)
@@ -425,7 +425,7 @@
/** Says nothing about the alpha channel */
inline bool isBlack() const {
- return m_max.rgb().max() == 0.0f;
+ return this->max().rgb().max() == 0.0f;
}
};
Complete stack trace is,
#0 G3D::UniversalSurface::transparencyType (this=0x55555887df90) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/UniversalSurface.cpp:40
#1 0x00007ffff7db4aa3 in G3D::UniversalSurface::renderDepthOnlyHomogeneous (this=0x55555887df90, rd=0x5555555cee90, surfaceArray=...,
previousDepthBuffer=std::shared_ptr<G3D::Texture> (empty) = {...}, minZSeparation=0, transparencyTestMode=..., transmissionWeight=...
) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/UniversalSurface.cpp:294
#2 0x00007ffff7d6b08b in G3D::Surface::renderDepthOnly (rd=0x5555555cee90, surfaceArray=..., cull=..., previousDepthBuffer=std::share
d_ptr<G3D::Texture> (empty) = {...}, minZSeparation=0, transparencyTestMode=..., transmissionWeight=...) at /home/dante/workspace/git/
g3d/G3D10/G3D-app.lib/source/Surface.cpp:337
#3 0x00007ffff7d540ff in G3D::ShadowMap::Layer::renderDepthOnly (this=0x555558610680, renderDevice=0x5555555cee90, shadowMap=0x555558
610600, shadowCaster=..., cullFace=..., polygonOffset=0, transparencyTestMode=..., transmissionWeight=...) at /home/dante/workspace/gi
t/g3d/G3D10/G3D-app.lib/source/ShadowMap.cpp:370
#4 0x00007ffff7d54029 in G3D::ShadowMap::Layer::renderDepthOnly (this=0x555558610680, renderDevice=0x5555555cee90, shadowMap=0x555558
610600, shadowCaster=..., cullFace=..., transparencyTestMode=..., transmissionWeight=...) at /home/dante/workspace/git/g3d/G3D10/G3D-a
pp.lib/source/ShadowMap.cpp:382
#5 0x00007ffff7d535b9 in G3D::ShadowMap::Layer::updateDepth (this=0x555558610680, renderDevice=0x5555555cee90, shadowMap=0x5555586106
00, shadowCaster=..., cullFace=..., transparencyTestMode=..., initialValues=std::shared_ptr<G3D::Framebuffer> (empty) = {...}, transmissionWeight=...)
at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/ShadowMap.cpp:361
#6 0x00007ffff7d529cf in G3D::ShadowMap::updateDepth (this=0x555558610600, renderDevice=0x5555555cee90, lightCFrame=..., lightProject
ionMatrix=..., shadowCaster=..., cullFace=..., transmissionWeight=..., passType=...) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/ShadowMap.cpp:278
#7 0x00007ffff7c434d0 in G3D::Light::renderShadowMaps (rd=0x5555555cee90, lightArray=..., allSurfaces=..., cullFace=...) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/Light.cpp:980
#8 0x00007ffff7cf9c2c in G3D::Renderer::computeShadowing (this=0x5555561fcd60, rd=0x5555555cee90, allSurfaces=..., ) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/Renderer.cpp:53
#9 0x00007ffff7af1524 in G3D::DefaultRenderer::render (this=0x5555561fcd60, rd=0x5555555cee90, camera= {...}, framebuffer = {...}, depthPeelFramebuffer = {...}, lightingEnvironment=..., gbuffer={...}, allSurfaces=...) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/DefaultRenderer.cpp:204
#10 0x00007ffff7b75595 in G3D::GApp::onGraphics3D (this=0x7fffffffc310, rd=0x5555555cee90, allSurfaces=...) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/GApp.cpp:1151
#11 0x00007ffff7b762fd in G3D::GApp::onGraphics (this=0x7fffffffc310, rd=0x5555555cee90, posed3D=..., posed2D=...) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/GApp.cpp:1208
#12 0x00007ffff7b7135b in G3D::GApp::loadScene (this=0x7fffffffc310, sceneName=...) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/GApp.cpp:953
#13 0x000055555555c947 in BallApp::onInit (this=0x7fffffffc310) at /home/dante/workspace/git/bouncy-ball/src/bball.cc:46
#14 0x00007ffff7b70471 in G3D::GApp::beginRun (this=0x7fffffffc310) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/GApp.cpp:1619
#15 0x00007ffff7b703fc in G3D::GApp::onRun (this=0x7fffffffc310) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/GApp.cpp:893
#16 0x00007ffff7b70338 in G3D::GApp::run (this=0x7fffffffc310) at /home/dante/workspace/git/g3d/G3D10/G3D-app.lib/source/GApp.cpp:877
#17 0x000055555555c553 in main (argc=1, argv=0x7fffffffe088) at /home/dante/workspace/git/bouncy-ball/src/bball.cc:13
I am loading the scene using basic objs with a albedo and a normal map,
5 │ name = "Level",
6 │
7 │ models = {
8 │ playerModel = ArticulatedModel::Specification {
9 │ filename = "models/ball.obj";
10 ~ │ };
11 ~ │ groundModel = ArticulatedModel::Specification {
12 ~ │ filename = "models/floor.obj";
13 ~ │ };
14 │ };
========================================================
60 │ player = VisibleEntity {
61 │ model = "playerModel";
62 ~ │ frame = Point3(0, 2, 0);
63 │ };
64 │
65 │
66 ~ │ ground = VisibleEntity {
67 ~ │ model = "groundModel";
68 ~ │ frame = Point3(0, 0, 0 );
69 ~ │ canChange = false
70 ~ │ };
Please let me know if you agree with the reasoning or (#2)I am doing something wrong here. There is a high chance of #2 happening here :)
Regards,
Siddharth