Why md2 can not do a transparent texture?
3 posters
Why md2 can not do a transparent texture?
in my demo,there is a md2 model,
it have a transparent texture,Is his hair,
But the pictures can not be transparent, and black edges.
texture is hair.tga
How to set Md2 do a transparent texture? thank you!
it have a transparent texture,Is his hair,
But the pictures can not be transparent, and black edges.
texture is hair.tga
How to set Md2 do a transparent texture? thank you!
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: Why md2 can not do a transparent texture?
Just set the _SIO2material->blend = SIO2_MATERIAL_COLOR for the material where the SIO2image is attached.
Re: Why md2 can not do a transparent texture?
thank you!sio2interactive wrote:Just set the _SIO2material->blend = SIO2_MATERIAL_COLOR for the material where the SIO2image is attached.
I tried it, But like this:
There are still black,Black should be transparent,but it did not,I tried SIO2_MATERIAL_ADD, SIO2_MATERIAL_VALUE.......,can not work.
why?
this is my code:
- Code:
SIO2Md2 m_pMd2;
m_pMd2 = sio2Md2Init( modelname );
m_pMd2->_SIO2material = sio2MaterialInit(texname);
sio2Md2Load( m_pMd2, _SIO2stream );
m_pMd2->_SIO2material->_SIO2image[ SIO2_MATERIAL_CHANNEL0 ] =sio2ImageInit(texname);
sio2ImageLoad(m_pMd2->_SIO2material->_SIO2image[SIO2_MATERIAL_CHANNEL0],_SIO2stream1);
m_pMd2->_SIO2material->blend = SIO2_MATERIAL_COLOR;///////////////////////
sio2ImageGenId(m_pMd2->_SIO2material->_SIO2image[ SIO2_MATERIAL_CHANNEL0 ],
NULL, 0.0f );
sio2Md2ClearAllAction( m_pMd2 );
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: Why md2 can not do a transparent texture?
Humm that should work... trace the code to make sure that the necessary blend state are set by SIO2... I never try alpha with MD2 but the material should work the same way as on a SIO2object.
Re: Why md2 can not do a transparent texture?
sio2interactive wrote:Humm that should work... trace the code to make sure that the necessary blend state are set by SIO2... I never try alpha with MD2 but the material should work the same way as on a SIO2object.
Thank you for your Reply!I think some of the details wrong.
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Re: Why md2 can not do a transparent texture?
Which rendering flags did you set as part of sio2ResourceRender()?
Francescu- Posts : 136
Join date : 2009-03-18
Re: Why md2 can not do a transparent texture?
Francescu wrote:Which rendering flags did you set as part of sio2ResourceRender()?
Yes,I did.
- Code:
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT
|SIO2_RENDER_TRANSPARENT_OBJECT
|SIO2_RENDER_ALPHA_TESTED_OBJECT/////Enable transparent
LuisLee- Posts : 85
Join date : 2009-04-26
Age : 37
Similar topics
» Proper z-ordering of transparent objects without texture
» Swapping a texture
» Draw font to texture or render to texture possible?
» Transparent Objects
» How to deal with transparent objects?
» Swapping a texture
» Draw font to texture or render to texture possible?
» Transparent Objects
» How to deal with transparent objects?
Permissions in this forum:
You cannot reply to topics in this forum