Z-ordering & shaders in Klepto's mod

BlitzMax Modules Forums/MiniB3D/Z-ordering & shaders in Klepto's mod

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.

This is the test app I used. When it requests a file, choose a texture with an alpha channel. Actually, even if you choose one without an alpha channel the error will still occur.

Import klepto.minib3d
Strict

Graphics3D 1024,768,32,0

Local cam:TCamera=CreateCamera()
CameraRange cam,.5,500
PositionEntity cam,0,10,-100

AmbientLight 100,100,100

Local mesh:TMesh=CreateCube()
EntityFX mesh,16
ScaleEntity mesh,10,10,10

EntityBlend mesh,1
EntityAlpha mesh,1

'Load any alphamapped texture
Local texture:TTexture=LoadTexture(RequestFile("Texture"),2)
TextureBlend texture,1

Local Tex:TBrush=CreateBrush()
BrushTexture(tex,texture)
BrushBlend tex,1
BrushAlpha tex,1
PaintMesh mesh,tex

' used by camera code
Local mxs#=0
Local mys#=0
Local move#=0.5
MouseXSpeed() ' flush
MouseYSpeed() ' flush

' used by fps code
Local old_ms=MilliSecs()
Local renders
Local fps

Local W:Byte = False

While Not KeyDown(KEY_ESCAPE)		

	If KeyHit(KEY_ENTER) Then DebugStop
	
	If KeyHit(Key_W) Then 
		Wireframe(Not W)
		W = Not W
	EndIf

	mxs#=mxs#+(MouseXSpeed()/5.0)
	mys#=mys#+(MouseYSpeed()/5.0)

	RotateEntity cam,mys#,-mxs#,0

	MoveMouse 1024/2,768/2
	MouseXSpeed() ' flush
	MouseYSpeed() ' flush

	
	If KeyDown(KEY_UP)=True Then MoveEntity cam,0,0,move# ' move camera forward
	If KeyDown(KEY_DOWN)=True Then MoveEntity cam,0,0,-move# ' move camera back

	If KeyDown(KEY_LEFT)=True Then MoveEntity cam,-move#,0,0 ' move camera left
	If KeyDown(KEY_RIGHT)=True Then MoveEntity cam,move#,0,0 ' move camera right
	
	UpdateWorld
	RenderWorld

	Flip
	
Wend
End