Creating a backdrop

Blitz3D Forums/Blitz3D Beginners Area/Creating a backdrop

SkyCube(Posted 2005) [#1]
Hello everyone,

It's been a while since I last posted. I've been trying to learn more about modeling, but I also need to practice more Blitz! Since I'm out of practice, I can't figure out how to achieve this simple effect: I want a sky background on my 3D level. For now, I am experimenting with simple colored images, but the background is always displayed black:

back = CreateImage(800,600)
SetBuffer ImageBuffer(back)
ClsColor 125,125,50
SetBuffer BackBuffer()


and in the main loop:

UpdateWorld
RenderWorld
DrawImage back,0,0
Flip
Wend


Is there another way to achieve this simple effect?


Robert Cummings(Posted 2005) [#2]
If I recall you need to set your CameraClsMode to 0 so that it does not overwrite the background, and draw the background FIRST.

This means that any areas in renderworld which aren't in view (ie. black) will not be drawn, so your bg will show through. That is why BG is drawn before renderworld and clsmode is set to 0.


big10p(Posted 2005) [#3]
You've also forgotten to do a Cls after the ClsColor command.


SkyCube(Posted 2005) [#4]
Hey thanks! It worked!

The trick was with CameraClsMode, like you said, Jack. Now that's something I wouldn't have found myself. The help page for this command is not very clear, though the example was good enough to show me.


Matty(Posted 2005) [#5]
Because of the way on many systems 2d and 3d commands can really slow down a game when used together you should possibly use a sprite or quad textured with your background texture and set the entityorder to a positive number so that it is drawn behind everything.