Archives Forums/Blitz3D Bug Reports/CreateTexture.

Abrexxes(Posted 2007) [#1]

I have made a programm with B3D 1.99 and Nvidia 6.14.0010.xxxx Drivers. After making a Demo of this i realize that every one with newer drivers (6.14.0011.xxxx) kann not see my textures created with the flag 260. Only 256 works. 258 works bu not correct.

So what is going on with the new drivers of nvidia and the blitzbasic flags of createtexture?

Edit, 258 was my faulkt, but 260 (256+4) no longer works

For me the problem is solved i can also use 258, so avoid flag "4" or "2".

Graphics3D 640,480
SetBuffer BackBuffer()
RotateEntity light,90,0,0
PositionEntity cube,0,0,5
tex=CreateTexture(256,256) ;<-- try FLAG 2 or 4 ...
;Driver Name: nv4_disp.dll
;Driver Version: 6.14.0011.6371 (English)

ixi = CreateImage (200,200)
SetBuffer ImageBuffer (ixi)
Color 255,0,255
Rect 0,0,150,150,1

SetBuffer TextureBuffer(tex)
ClsColor 255,255,255

SetFont font
Color 0,0,0
Text 0,0,"Diese Textur"
Text 0,40,"wurde erstellt mit"
Color 0,0,255
Color 0,0,0
Text 0,120,"und eingezeichnet mit"
Color 0,0,255
EntityTexture cube,tex
SetBuffer BackBuffer()

CopyRect 0,0,200,200,0,0,ImageBuffer(ixi), TextureBuffer (tex)

While Not KeyHit(1)
   If KeyDown(208)=1 Then pitch#=-1
   If KeyDown(200)=1 Then pitch#=1
   If KeyDown(203)=1 Then yaw#=-1
   If KeyDown(205)=1 Then yaw#=1
   If KeyDown(45)=1 Then roll#=-1
   If KeyDown(44)=1 Then roll#=1
   TurnEntity cube,pitch#,yaw#,roll#
   Text 0,0,"Drehe den Würfel mit Cursortasten" Flip

Ross C(Posted 2007) [#2]
Well, flag 2 and 4 are responsible for alpha blending and masking. Using flag 2, you have made your textures see through. Same with using flag 4. You are masking off the dark parts.

You need to explain more about what you don't want to happen :o)

Ross C(Posted 2007) [#3]
Right, ok i see what you mean now. I think there was a few problem with the VRAM flag. It seems to display the texture differently by adding the VRAM flag. Well, looks like a bug to me :o)

Basically, the way it works WITHOUT the VRAM flag, should be correct, as the copyrect command doesn't copy any alpha information.


Abrexxes(Posted 2007) [#4]
Yep. My problem was that i create a texture and copy the texture to an image buffer. With older drivers that works perfekt (and fast), but with the newest driver from nvidia i can not use the texture if i make the flag 2 or 4. The texture is always empty.

But its only with self made textures (CreateTexture). If i load a texture everything is fine.


Ross C(Posted 2007) [#5]
The only thing i can think of, is not to use copyrect when transfering between an imagebuffer and a texture buffer. You could try Readpixelfast and writepixelfast? They copy alpha information, so you will have more control over it.

Abrexxes(Posted 2007) [#6]
Isnt fast enought. But you can test my final port of escape if it works (run a sample and look if you can see the GUI.)

I will wait a time and see what happents and start with other thinks (without CreateTexture und Bufferdirthy ;P ) So escape3D is a mix of escape and draw3D.

ZJP(Posted 2007) [#7]
escape3D :-) .Very cool stuff !!!