3d snapshot

Blitz3D Forums/Blitz3D Programming/3d snapshot

AbbaRue(Posted 2004) [#1]
I was wondering if there is a way to make a snapshot of a
3D scene and project it to the background, so it can be
used as a scenery backdrop.
My reason for asking: I want to render objects in the
distance once every say 20 frames, and then use the image
as a backdrop. Then just render closeup objects every
frame. I don't want to see a blue sky in the distance
when there should be a mountain there.


Bouncer(Posted 2004) [#2]
Just render the scene in to an image buffer and use it as a background, or render to backbuffer... copy to texture and use a textured sprite on a background.


BlitzSupport(Posted 2004) [#3]
It'll have to be the latter -- render as normal, grab from back buffer to either an image or texture buffer, then display either as an image or a textured sprite...


Ross C(Posted 2004) [#4]
Don't believe you can render to a image or texture buffer...


AbbaRue(Posted 2004) [#5]
Thanks for the help.


Bouncer(Posted 2004) [#6]
Ross C: My bad... RenderWorld always renders to backbuffer.


AbbaRue(Posted 2004) [#7]
I copied the screen to an imagebuffer.
Now how do I turn that imagebuffer into a sprite, so I can use it as a backdrop.

gfxBlank=CreateImage (1024,768)
CopyRect 0,0,1024,768,0,0,FrontBuffer(),ImageBuffer(gfxBlank)

The screen is now in the ImageBuffer, but I can't use it.

If I use the following.
CopyRect 0,0,1024,768,0,0,ImageBuffer(gfxBlank),FrontBuffer()

It is overwritten by the BackBuffer on the next frame.
So it needs to be made into a sprite, so it stays on the screen in the background.


MagicalTux(Posted 2004) [#8]
Simplest :

1. Disable clear screen on render via CameraClsMode
* START LOOP
2. Draw your image at the background
3. Call Render
4. Flip screen
* END OF LOOP


AbbaRue(Posted 2004) [#9]
Thanks MagicalTux, that worked.