Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in sky.cpp add that at line #86
- sun = mgr->addLightSceneNode(this,
- core::vector3df(0,10000*BS*2,0),
- video::SColorf(1.0f, 1.0f, 1.0f, 1.0f), 30000);
- video::SLight *ldata = &sun->getLightData();
- ldata->AmbientColor = video::SColorf(0.2f, 0.2f, 0.2f, 1.0f);
- you will set up light source for our world.
- now set materials in mapblock_mesh.cpp #1202:
- material.setFlag(video::EMF_LIGHTING, true);
- now you have ligths enabled
- start the game without shaders: you will see that world is lit by the source
- enable shaders now,
- world is not lit by light source, it still works on vertex colors we have set.
- conclusion: when you are using default materials, irrlicht is adding own shaders
- when you are modyfing them you have to do your own light calculations.
- All the lightsource data are passed into your shader. Pos, ambient, specular etc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement