introscreens

Blitz3D Forums/Blitz3D Programming/introscreens

OK I am using a sprite to fade in and out to create an intro screen effect... I load the screen as a texture and then adjust the entityalpha of the sprite... Simple sample code:
; fadein by Rook Zimbabwe
;
Graphics3D 800,600,16,1
SetBuffer BackBuffer()
AppTitle "FADER 1.0"

cam = CreateCamera()
PositionEntity cam,0,0,-10

Cls

startright=LoadTexture("front.png")

Global ghost
Global ghost2
Global b#
Global gome
Global flipper = CreateSprite()
EntityTexture flipper,startright

PositionEntity flipper,0,0,-8.5

oldtime = MilliSecs()
b#=0
ghost=1

While Not KeyHit (1)

If ghost = 0 Then 
Delay 125
ghost2=1
EndIf

If ghost = 1 Then fadein()

If ghost2 = 1 Then fadeout()
RenderWorld()

Text 0,12,"ALPHA: "+b#
Text 0,24,"Ghost: "+ghost
Text 0,36,"G2: "+ghost2
Text 0,48,"GOME: "+gome

Flip

Cls

Wend

End
; ########################### FUNCTIONS
;
; ########################### FADEIN
Function fadein()

If MilliSecs() > oldtime+50 Then
b# = b# + .01
If b# > 1 Then 
	b# = 1
	ghost = 0
EndIf
EntityAlpha flipper,b#
oldtime = MilliSecs()

EndIf

End Function
; ########################### FADEOUT
Function fadeout()

If MilliSecs() > oldtime+50 Then
b#=b#-.01
If b#<.001 Then 
	b#=0
EndIf
If b#=0 Then gome=1
EntityAlpha flipper,b#
oldtime = MilliSecs()

EndIf

End Function
; ###########################
The code is uncommented but is really simple to understand...

My problem is this:
The screen looks slightly "fuzzy" and not sharp... I want to do better... HOW???

The screen looks slightly "fuzzy" and not sharp... I want to do better... HOW???
Use a bigger image.

Yup, I used that for Death Island.
Use the actual screen size, but play around with the scale.
Thtas probably your problem. What's the scale-to-pixel rate though for distances? Objects farther seem smaller, but by how much?

I have one 1024X758 and it still looks fuzzy... How big? OK another stupid question... do I scale the sprite before I apply texture or does that make a difference?

..

i don't think it makes any difference. You need some code to get the scales so that there is no interpolation - one image pixel maps to one screen pixel- search this site for 'pixies' - a bit of code by Boyd that does just this.

I think its a texture [filtering] quality issue - and given this is set
in directx - there is perhaps only one solution..
Using the new commands + creating a small dx7 based dll,
you might be able to set the texture quality - but this
is assuming mark doesnt reset it at render time...+its
quite an ugly cludge...hmmm..i may try this myself :]

>>things tried in the past..
..large textures, cleartexturefilters(),
ortho projection - jst incase some weird perspective opp
may have been the source of the trouble..nothing works..

I tried to draw the image to the screen and place the sprite in front of the camera and GRADUALLY decrease its alpha to look like a fadein... couldn't see anything... Perhaps I coded it wrong.

mind that cameras have a near/far clip zone..if you placed
your sprite outside this area you wouldnt have seen anything.. this is usually set to 1.0 nearclip, 100 or more
for farclip...

In the code archives there is code about positioning 3D sprites pixel perfect in 2D. On top of that you want to ClearTextureFilters

http://www.blitzbasic.com/codearcs/codearcs.php?code=456
http://www.blitzbasic.com/codearcs/codearcs.php?code=379
http://www.blitzbasic.com/codearcs/codearcs.php?code=321

And look at the optional flags used when loading textures - think you need to set one of them for alpha blending.

Flaken... if you mena in my game... that was my bad... 0,0,0 PNG issue... fixed it better now!

Rob... lotta research there... I may have to use a psrite lib. I tried brushing a cube but it still looked bad.

Maybe it is because the sprite is sooooooooo close to the camera and not scaled up instead? I will learn and try again!

RZ