R2T and alpha

BlitzMax Forums/BlitzMax Programming/R2T and alpha

BlackSp1der(Posted 2006) [#1]
Hi.
I'm testing the Indiepath R2T module and I found a problem when an Image with alpha values are used over a solid image. The new alpha superimpose its alpha instead of doing a comparative max(alpha1,alpha2).
Did anyone have found any solution for that? I haven't found any DX command to solve it.



Strict
Import Indiepath.Render2Texture

SetGraphicsDriver D3D7Max2DDriver()
Graphics 800,600
SetBlend(ALPHABLEND)
tRender.Initialise()

Local myImage:TImage = tRender.Create(256,256)
tRender.TextureRender_Begin(myImage)
	tRender.Cls($90FF0000)
	draw
tRender.TextureRender_End()


Local line:Int
Repeat
tRender.BackBufferRender_Begin()
	Cls
	line=(line+5) Mod 350
	DrawRect 0,100+line,800,5
	draw
  	DrawImage myImage,520,150
tRender.BackBufferRender_End()
	Flip
Until KeyHit(KEY_ESCAPE) Or AppTerminate()


Function draw()
	DrawRect 100,50,500,500

	SetColor 0,0,255
	SetAlpha 0.5
	DrawOval 200,200,150,150

	SetAlpha 1
	DrawOval 400,400,150,150
	SetColor 255,255,255
EndFunction