Shadow Troubles

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
MilitantGolf
Posts: 4
Joined: Fri Dec 13, 2013 11:25 pm

Shadow Troubles

Post by MilitantGolf »

I was trying to get shadows working in my game.
When I ran the Game with the shadow test the Shadow rendered in an exact 90 degree angle
What can cause this?
CuteAlien
Admin
Posts: 10051
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Shadow Troubles

Post by CuteAlien »

No idea. Do you do anything special with the nodes? Also can you make a screenshot? (you can post it to imgur if you don't have a webserver)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
MilitantGolf
Posts: 4
Joined: Fri Dec 13, 2013 11:25 pm

Re: Shadow Troubles

Post by MilitantGolf »

Here is The node code Is there anything needed to render shadows?

Code: Select all

 
    mesh = smgr->getMesh("Bin/swd.x");
    if (!mesh)
    {
        device->drop();
        return 1;
    }
    node = smgr->addAnimatedMeshSceneNode( mesh );
    
    if (node)
    {
        auto sh = node->addShadowVolumeSceneNode();
        //node->setMaterialType(E_MATERIAL_TYPE::EMT_SOLID);
        node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
        node->setScale(vector3df(1,1,1));
        auto ab = node->getPosition();
        ab.Y += 10;
        node->setPosition(ab);
        node->setMaterialTexture( 0, driver->getTexture("Bin/swdtxt.png") );
        
        smgr->setShadowColor(video::SColor(150,0,0,0));
    }
This somehow renders the shadow inverted rotation from the mesh
CuteAlien
Admin
Posts: 10051
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Shadow Troubles

Post by CuteAlien »

Can you try modifying example 08 and just replacing the dwarf by your model? Are the shadows then also inverted?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply