Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#Actualbelfegor

Posted 27 January 2013 - 08:06 AM

Are you doing something like this? You may need to disable some states after you finish drawing transparent objects.
...
DrawSky();
DrawTerrain();
 
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
... // other states
 
DrawLeaves();
 
device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); // disable alpha blend
device->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); // i am not sure maybie this one needs to be disabled also

I would like to advise you to take a look at tutorial on http://www.cgtextures.com/ under "Tutorial" menu "Alpha mask background trick".

#1belfegor

Posted 27 January 2013 - 08:03 AM

Are you doing something like this? You may need to disable some states after you finish drawing transparent objects.

 
...
DrawSky();
DrawTerrain();
 
device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
... // other states
 
DrawLeaves();
 
device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); // disable alpha blend
device->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); // i am not sure maybie this one needs to be disabled also

PARTNERS