A way to combine texture alpha channel w/ vertex alpha?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
helmuthschmitz
Posts: 11
Joined: Tue Feb 15, 2011 1:56 pm

A way to combine texture alpha channel w/ vertex alpha?

Post by helmuthschmitz »

I'm losing my mind trying to find a way to combine EMT_TRANSPARENT_ALPHA_CHANNEL with EMT_TRANSPARENT_VERTEX_ALPHA.

I want do draw a mesh with a texture with alpha channel but with a fade out covering all the mesh.

So, what can i do?

Code: Select all

virtual void render()
    {
        u16 indices[] = {   0,2,3, 2,1,3, 1,0,3, 2,0,1  };
        video::IVideoDriver* driver = SceneManager->getVideoDriver();
        
       //i use this to texture alpha... 
        Material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
        driver->setMaterial(Material);
        driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
 
        driver->drawVertexPrimitiveList(&Vertices[0], 4, &indices[0], 4, video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT);
    }
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: A way to combine texture alpha channel w/ vertex alpha?

Post by Nadro »

It this case you should use shaders :)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
helmuthschmitz
Posts: 11
Joined: Tue Feb 15, 2011 1:56 pm

Re: A way to combine texture alpha channel w/ vertex alpha?

Post by helmuthschmitz »

Thanks man!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: A way to combine texture alpha channel w/ vertex alpha?

Post by hybrid »

You can also use the ONE_TEXTURE_BLEND material, which supports alpha values from different sources.
Post Reply