Entityalpha = flicker?

Blitz3D Forums/Blitz3D Beginners Area/Entityalpha = flicker?

Dock(Posted 2004) [#1]
"Entityalpha entity,0" is causing the object to flicker like crazy rather than render it invisible. Even changing my entity alpha to 0.5 makes it flicker, so it doesn't seem to be doing the job properly at all. Is there something I'm missing?


semar(Posted 2004) [#2]
Any chance to see the offending code ?

Anyway, I guess you're missing a Flip command in your main loop.

It should look like this:
graphics3d 640,480,0,2
cube = createcube()
entityalpha cube,0.5
positionentity cube,0,0,5
cam = createcamera()

;main loop
while not keydown(1);esc quits

turnentity cube,1,1,1
updateworld()
renderworld()

Flip ;this is the command you are perhaps missing ?

wend
end


Do you still get flickering with the code above ?

If your entity flickers, and it's a 3Dsprite, then try to put it a bit far away from the camera.

Hope this helps,
Sergio.


Dock(Posted 2004) [#3]
Hi Sergio, thanks for the help.

Your example seems to work fine, but my code doesn't. I'll try to post something when I get home from work. I'm not missing the flip command, so I'll poke around and see what I'm doing wrong.

Thanks again.


morduun(Posted 2004) [#4]
Betting you're using frame tweening. I seem to recall a bunch of folks reporting they get flickering when they try to combine alpha with tweening. Unfortunately I don't remember how (or even if) they resolved this but it might give you some leads.


Clyde(Posted 2004) [#5]
I've ammended and added the backbuffer and a cls command in the loop to refresh nicely.

Hope it helps mate :)




Dock(Posted 2004) [#6]
yes I'm using frame tweening. I'll try to disable it tonight and see if it helps... but of course I would prefer to keep it in :)

Mikey F - setting the BackBuffer() doesn't make any difference to my code.


semar(Posted 2004) [#7]
@Mikey F,
yes the command Setbuffer BackBuffer() is very important, I did not include in the example above just because the command Graphics3D performs it automatically.

'Graphics' does not, but 'Graphics3D' does.

Well spotted though.

@Dock,
are you really sure you need frame tweening ? Usually, a simple timer does already a good job, and gives no hassle..

Sergio.


Dock(Posted 2004) [#8]
Actually I think it's frame limiting, not frame tweening, that I'm using. However, disabling the frame limiting doesn't really seem to help... it just makes the entity solid, even with entityalpha 0. Hmm, I might try to build this code from scratch, it's too messy to try to place here as an example.


Dock(Posted 2004) [#9]
Yay - I found the solution.
Yep, it was definitely the frame tweening to blame. Once I changed 'Renderworld tween' to 'Renderworld', it worked perfectly well.

I suspect that it was because I wasn't using 'captureworld' in conjuction with renderworld tween, as the docs recommend I do. Could this be the case?

Either way, I now have transparency fixed! :) Thanks for the help of everyone here, it's because of you guys that I'm able to keep going with Blitz.


Sunteam Software(Posted 2004) [#10]
Yes the CaptureWorld command does help the tweening, the Marcoworld example that should have come with your Blitz has some solid frame tweening code, there are also plenty of examples (I think) in the code archives.