masking textures

Blitz3D Forums/Blitz3D Beginners Area/masking textures

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Pretty much .. you're other texture should be "winter1.jpg" as this is the black & white version.

Simple example ..
Graphics3D 640,480,16,1

;create texture1
Tex1 = CreateTexture( 128,128 )
SetBuffer TextureBuffer( Tex1 )
For y = 0 To 127
	For x= 0 To 127
		Color 64,Rnd(64,192), 64
		Plot x, y
	Next
Next
;create texture2 (mask)
Tex2 = CreateTexture( 128,128 )
TextureBlend Tex2, 2
SetBuffer TextureBuffer( Tex2 )
Color 255,255,255
Oval 0,0,128,128,1

SetBuffer BackBuffer()

;camera
Camera = CreateCamera()
PositionEntity Camera, 0, 0, -10

;background
Plane1 = CreatePlane()
RotateEntity Plane1, -90,0,0
PositionEntity Plane1, 0, 0, 1
EntityTexture Plane1, Tex1, 0, 0

;foreground
Plane2 = CreatePlane()
RotateEntity Plane2, -90,0,0
EntityTexture Plane2, Tex1, 0, 0
EntityTexture Plane2, Tex2, 0, 1 
EntityAlpha Plane2, .25


While Not KeyDown(1)

	RenderWorld()
	Flip
	
Wend


Stevie