Commit 338ba2ac authored by nadro's avatar nadro

- Fixed blending issues in examples.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4130 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 114f94e2
......@@ -188,7 +188,7 @@ int main()
ps->setMaterialFlag(video::EMF_LIGHTING, false);
ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
ps->setMaterialTexture(0, driver->getTexture("../../media/fire.bmp"));
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
/*
Next we add a volumetric light node, which adds a glowing fake area light to
......
......@@ -105,14 +105,10 @@ public:
if (UseHighLevelShaders)
{
services->setVertexShaderConstant("mTransWorld", world.pointer(), 16);
if(driver->getDriverType() == video::EDT_OPENGL)
{
// set texture
f32 TextureLayerID = 0.0f;
if (UseHighLevelShaders)
services->setPixelShaderConstant("myTexture",
reinterpret_cast<f32*>(&TextureLayerID), 1);
}
// set texture, for textures it's very important to pass an int instead of float for a setPixelShaderConstant method.
s32 TextureLayerID = 0;
if (UseHighLevelShaders)
services->setPixelShaderConstant("myTexture", &TextureLayerID, 1);
}
else
services->setVertexShaderConstant(world.pointer(), 10, 4);
......
......@@ -171,9 +171,6 @@ int main()
{
// ask user for driver
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
if (driverType==video::EDT_COUNT)
return 1;
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
if (driverType==video::EDT_COUNT)
return 1;
......
......@@ -539,8 +539,7 @@ void CDemo::loadSceneData()
campFire->setMaterialFlag(video::EMF_LIGHTING, false);
campFire->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
campFire->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp"));
campFire->setMaterialType(video::EMT_ONETEXTURE_BLEND);
campFire->getMaterial(0).MaterialTypeParam=video::pack_textureBlendFunc(video::EBF_ONE, video::EBF_ONE_MINUS_SRC_ALPHA, video::EMFN_MODULATE_1X, video::EAS_VERTEX_COLOR);
campFire->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
// load music
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment