Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: <SOLVED> Draw_FilledBox doesn't set Alpha?  (Read 1401 times)
serial
Customers
Community Member
*****
Posts: 380


« on: December 04, 2007, 01:01:25 AM »

Code:
rs2 = scene.CreateAlphaRenderSurface(128, 128)
            rs2.StartRender()
            immediate.Action_Begin2D()
            immediate.Draw_FilledBox(0, 0, 128, 128, glo.RGBA(0, 0, 0, 0))
            immediate.Action_End2D()
            rs2.EndRender()
            rs2.SaveTexture(path & project & "\" & cellname(x, z) & "\alpha.dds", CONST_TV_IMAGEFORMAT.TV_IMAGE_DXT5)
            rs2.Destroy()

I'm my world editor when I create a landscape.tvl I also create an associated alpha map. 
Currently I do that by drawing a filled box to the screen.  I want to the values to be
all 0 by default.  I've been chasing a 'bug' for a few days only to realize that Draw_FilledBox doesn't seem to draw in the alpha channel.  At least that is the only conclusion I could come up with for its behavior. 
« Last Edit: December 04, 2007, 01:42:39 PM by serial » Logged
SylvainTV
Administrator
Community Member
*****
Posts: 4946


WWW
« Reply #1 on: December 04, 2007, 07:09:47 AM »

Well it tries to set all to 0  but it can't because alphablending and alphatesting are enabled by Default. You must disable them before rendering to the RS. (immediate.Settings* functions)
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
serial
Customers
Community Member
*****
Posts: 380


« Reply #2 on: December 04, 2007, 01:42:14 PM »

Oh,  that fixed it :p

Thanks

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks