CreateTexture()

Blitz3D Forums/Blitz3D Programming/CreateTexture()

The example in the online docs works, but when I tried to texture a Plane with this, the colour doesn't work. It's all grey.

Graphics3D 1024,768,32,0
SetBuffer BackBuffer()
cam=CreateCamera()
CameraViewport cam,0,0,1024,768

PositionEntity cam,0,10,-20

light=CreateLight(1)
LightColor light,200,200,200
enemy=CreateCone(50)
EntityColor enemy,205,100,100
EntityShininess enemy,0.7

player=CreateCone(50)
EntityColor player,100,205,200
EntityShininess player,0.7

PointEntity cam,player
EntityParent cam,player

AmbientLight 100,100,100

Grid=CreatePlane(16)
GridT=CreateTexture(256,256,1)

SetBuffer TextureBuffer(GridT)
ClsColor 0,0,0
Cls
Color 200,200,255
Rect 32,32,213,213,1
Color 50,50,75
Rect 64,64,128,128,1
SetBuffer BackBuffer()

EntityTexture Grid,GridT

Espeed#=0.1
PSpeed#=0.1

While Not KeyDown(1)

Espeed#=Espeed#+0.01
Pspeed#=Pspeed#+0.01

MoveEntity enemy,0,0,Espeed#
MoveEntity player,0,0,Pspeed#

UpdateWorld
RenderWorld

Flip
Wend


I believe the ATI cards have trouble with dynamic textures.

I believe the ATI cards have trouble with dynamic textures.


I did a test a while back and a bunch of people tested it. Once I set the color texture flag explicitly, there were no problems with any videocards.

That demo works fine here though, so it is evidently a driver problem of some kind. My demo only used writepixel's, so maybe that's the difference.

Erm.. not sure what else to suggest. Try CreateTexture(256,256,8+1) ? That'll enable mipmapping ( it looks horrible without ) but I can't see any necessity for it.

You could hunt up the demo I did. I think the thread was called "Please Break This" and it was in General Discussions.