FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Why md2 can not do a transparent texture?

3 posters

Go down

Why md2  can not do a transparent texture? Empty Why md2 can not do a transparent texture?

Post  LuisLee Wed Sep 23, 2009 1:51 am

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!

Very Happy

LuisLee

Posts : 85
Join date : 2009-04-26
Age : 37

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  sio2interactive Thu Sep 24, 2009 1:04 am

Just set the _SIO2material->blend = SIO2_MATERIAL_COLOR for the material where the SIO2image is attached.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  LuisLee Thu Sep 24, 2009 1:28 am

sio2interactive wrote:Just set the _SIO2material->blend = SIO2_MATERIAL_COLOR for the material where the SIO2image is attached.
thank you!

I tried it, But like this:
Why md2  can not do a transparent texture? Pictur14

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

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  sio2interactive Thu Sep 24, 2009 3:31 am

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.
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  LuisLee Thu Sep 24, 2009 4:04 am

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.


Very Happy

LuisLee

Posts : 85
Join date : 2009-04-26
Age : 37

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  Francescu Thu Sep 24, 2009 7:32 am

Which rendering flags did you set as part of sio2ResourceRender()?

Francescu

Posts : 136
Join date : 2009-03-18

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  LuisLee Thu Sep 24, 2009 7:13 pm

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

Back to top Go down

Why md2  can not do a transparent texture? Empty Re: Why md2 can not do a transparent texture?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum