Secondary Texture Set

Blitz3D Forums/Blitz3D Programming/Secondary Texture Set

Giving each texture a different blend mode produces a better result. I think it might be something to do with you changing the textures colour. Maybe to do with alpha values in the texture?

Graphics3D 640,480,0,2

Global firstTexture=CreateTexture(4,4)
colourTex(firstTexture,255,0,0)

Global shadowTexture=CreateTexture(4,4)
TextureCoords shadowTexture,1
colourTex(shadowTexture,0,255,0)

SetBuffer BackBuffer()
sphere=CreateSphere(4)
EntityTexture sphere,firstTexture      ; Disable Line A
TextureBlend firsttexture,1
EntityTexture sphere,shadowTexture,0,1 ; Disable Line B
TextureBlend shadowtexture,3


camera=CreateCamera()
PositionEntity sphere,0,0,4

Repeat
	RenderWorld
	Flip 0
Until KeyDown(1)


Function colourTex(texture,r,g,b)
SetBuffer TextureBuffer(texture)
Color r,g,b
For x=0 To TextureWidth(texture)
For z=0 To TextureHeight(texture)
Plot x,z
Next
Next
SetBuffer BackBuffer()
End Function