A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / system way vblank synchro ? warp3d.

 

Author Message
kas1e
Member
#1 - Posted: 5 Feb 2005 12:38
Reply Quote
I writing some system friendly code for warp3d under aos3.x (hope it work on aos4.x) on C, on my 040/33 + voodoo3. So, for example i want to do some rotate/animate/etc. effects on my 'backscreen' picture (640x512x32bit picture,splited on 6 textures: 4 256x256, and 2 128x256). Usualy way:

for (angle=0;angle<PI*2;angle+=0.01)
{
>draw rotate shit<
WaitTOF();
>draw part of 'backscreen'
};

But WaitTOF() can't give me good synchro everytime. Do anyone to know others way for synchro under os ? Maybe need do it some sort of 'in time' code for syncro ?
krabob
Member
#2 - Posted: 7 Feb 2005 11:12
Reply Quote
As documented, WaitTOF() * SHOULD * synchronize with the focused screen's top of frame. But it is known that even with a CGX classic screen, it keeps synchronized with aga (50Hz pal or 60Hz ntsc), whatever the vga frequency is. I don't know how to bypass this problem.
kas1e
Member
#3 - Posted: 7 Feb 2005 13:02
Reply Quote
but what about mawi/encore/universe/ephedrena demos ? it is work fine under cgx screen, and synchro everytime is good. I think maybe it is timer.device + fps routine maybe ?
krabob
Member
#4 - Posted: 8 Feb 2005 15:56
Reply Quote
99% of the cgx demo, warp3d or software chunky, don't synchonize their top of frame.... and fasten your belt: software chunky screens can't use double buffer (even if graphics and intuition .library know functions for it) ! they use a screen copy on video mem, and swap at any time in the frame. Most of the time it isn't that ugly.

For warp3d, i don't know if double buffer is possible. Look respirator stories on a CGX screen: there are black and white quick flashes at 25 or 50Hz: on aga they are nice ,but on cgx you can see horizontal lines. Hey, it's the same thing in the PC world.

On cgx/software, there is a trick with vertical scrooling to fake a nice double buffer, but it's difficult to get it work everywhere. But To get it synchro with a nice TOF, I don't know.

Hey what about buying a TFT screen, there are no scanline concepts :-)
kas1e
Member
#5 - Posted: 8 Feb 2005 18:53
Reply Quote
I am render/show all scenes to first screen :) so, for little scenes (sprite drawing, alpha fade) it is work good with WaitTOF() and WaitBOVP(). But if i trying to use animation, i have ugly bugs kind of 'some areas of screen blinking'. So, i fuckup 2 days with WaitTOF/etc, but as i understand, double-buffering only can help me with good animation. So..

I am reading intuition/graphics/warp3d autodocs, and founded some interesing moments:

for double-buffering we have 2 ways:

1. ScrollVPort
2. ScreenBuffer (alloc/change/free)

For warp3d we can do it context with 'fake double-buffering'. From warp3dev:

------------------
The W3D_CC_YOFFSET tag item is used for double buffering the CyberGraphX style. This specifies the top scanline used for rendering. All coordinates will be relative to this line, meaning the the offset is automatically added to the Y coordinates. When you switch display with ScrollVPort, you will need to set a new drawing area with W3D_SetDrawRegion, you can change this offset.
------------------

Well,if i create one more buffer, render all drawing to this buffer, and in loop switch to main screen, i must be have nice animation. (i hope :) ).
kas1e
Member
#6 - Posted: 22 Mar 2005 11:14
Reply Quote
I think it is can be interesting to someone. So, after some stupid questions and tests, i can said that best way for warp3d double buffering/good synchro it is ScreenBuffer functions from intuition.library. W3D_CC_YOFFSET + ScrollVPort are suxx. ScreenBuffer funcs can give all what you need. If anyone will interesting in talk about it, i can give some explain/examples.

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0