Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One simple question! #2

Open
zhangfq-chemistry opened this issue Aug 2, 2022 · 1 comment
Open

One simple question! #2

zhangfq-chemistry opened this issue Aug 2, 2022 · 1 comment

Comments

@zhangfq-chemistry
Copy link

I cannot understand PBRInstancedMaterial. Is it a simple shader to replace lightEntity? Is there a simply way to set Env Light such as "lightEntity = new Qt3DCore::QEntity(camera())"? I saw the color information has been transferred to Klein::ConcretePointsRenderer/Klein::ConcreteLinesRenderer, and so each geometry owns its material. Thanks!

// Add PBR material
auto pointsMaterial = new Klein::PBRInstancedMaterial(rootEntity);
pointsMaterial->setUseInstanceColor(true);
pointsMaterial->setRoughness(1.0f);
pointsMaterial->setMetalness(0.0f);
pointsMaterial->setEnvLightBrdf(brdfMap);
pointsMaterial->setEnvLightIntensity(1.0f);

@unclejimbo
Copy link
Owner

Hi @zhangfq-chemistry, PBRInstancedMaterial uses gpu instancing to render a bunch of meshes with different transform matrices, which is exactly what ConrectePoints/Lines do (render lots of spheres or cylinders). Environment lighting is another issue. I sort of just hacked the envlight properties into the PBR materials by adding the QParameters into BasePBRMaterial in order to update the uniform buffers. The way I did it is because, as long as I recall, it's a bit hard to update the uniform buffers without a material like QEnvironmentLight by only using the qt3d public api. Maybe you could give it a try though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants