[Solved] After updated version some shadow disappear

Problems building or running the engine, queries about how to use features etc.
Post Reply
dcavallini
Gnoblar
Posts: 17
Joined: Fri Jul 16, 2021 10:04 am
x 2

[Solved] After updated version some shadow disappear

Post by dcavallini »

Ogre Version: : 13.5.2:
Operating System: :windows 10:
Render System: :OpenGL 3+,D3D11:

I updated ogre3d from 13.1.1 to 13.5.2 and some shadows disappear.
Get tutorial 2 and add code below

Code: Select all

    createSphere("mySphereMesh", 30, 16, 16);
    Entity* sphereEntity = scnMgr->createEntity("mySphereEntity", "mySphereMesh");
    sphereEntity->setMaterialName("Examples/Rockwall");
    SceneNode* sphe = scnMgr->getRootSceneNode()->createChildSceneNode();
    sphereEntity->setCastShadows(true);
    sphe->translate(30, 100, 0);
    sphe->attachObject(sphereEntity);

createSphere() is the function in https://wiki.ogre3d.org/ManualSphereMeshes
Shadow from ninja.mesh work , but shadow of sphere not appear. See the image.
With 13.1.1 work fine. Where is my error?

Image

Image

Last edited by dcavallini on Mon Nov 28, 2022 9:48 am, edited 1 time in total.
rpgplayerrobin
Gnoll
Posts: 617
Joined: Wed Mar 18, 2009 3:03 am
x 353

Re: After updated version some shadow disappear

Post by rpgplayerrobin »

What kind of shadows are these?
If they are stencil shadows, the edge list might now need to be built for meshes.

Since edge list are useless when not using stencil shadows (which are heavily outdated, used only 10+ years ago), it could be that edge lists were removed from the mesh when using "createSphere".
What if you do this?

From:

Code: Select all

createSphere("mySphereMesh", 30, 16, 16);

To:

Code: Select all

createSphere("mySphereMesh", 30, 16, 16);
MeshPtr tmpMesh = Ogre::MeshManager::getSingleton().getByName("mySphereMesh");
tmpMesh->buildEdgeList();

That should build the edge list for the mesh which should make it work with stencil shadows.

dcavallini
Gnoblar
Posts: 17
Joined: Fri Jul 16, 2021 10:04 am
x 2

Re: After updated version some shadow disappear

Post by dcavallini »

Thank you for reply. With buildEdgeList function shadow work fine.
I am forced to use stencil shadow technique because if entity casts shadows then it cannot receive with texture technique.
You see viewtopic.php?t=96697 thread.
In my project need this.
Resolved!

Post Reply