3D overlay multipass render

Blitz3D Forums/Blitz3D Programming/3D overlay multipass render

Craig H. Nisbet(Posted 2004) [#1]
Does anyone have an example of how to set up a overlay render in blitz 3d that is a seperate render from the rest of the world? I have 3d sprite elements I want to render on top of my scene, but I don't want them to be part of the same renderworld as the background geometry. So I'll have to do a second renderworld for the overlay graphics. Anyone know how to accomplish this?


Rob Farley(Posted 2004) [#2]
Set the camera cls mode of your second camera for your hud so it doesn't clear the screen.


_PJ_(Posted 2004) [#3]
Second camera? Although this would be quite slow.

I dunno...that's about as techy as I get :/


Rob Farley(Posted 2004) [#4]
Just knocked this up.

Graphics3D 640,480

hudcam=CreateCamera()

hud1=CreateCube(hudcam)
PositionEntity hud1,5,3,7
hud2=CreateCube(hudcam)
PositionEntity hud2,-5,3,7
hud3=CreateCube(hudcam)
PositionEntity hud3,5,-3,7
hud4=CreateCube(hudcam)
PositionEntity hud4,-5,-3,7

CameraClsMode hudcam,False,True

PositionEntity hudcam,-100000,100000,0


cam=CreateCamera()

For n=1 To 100
temp=CreateSphere(4)
PositionEntity temp,Rand(-50,50),Rand(-10,10),Rand(-50,50)
EntityColor temp,Rand(200,255),Rand(200,255),Rand(200,255)
Next



Repeat

TurnEntity cam,0,1,0

UpdateWorld
HideEntity hudcam
ShowEntity cam
RenderWorld
HideEntity cam
ShowEntity hudcam
RenderWorld
Flip
Until KeyHit(1)



Craig H. Nisbet(Posted 2004) [#5]
I gotcha, That's very clever! Thanks Rob!


Warren(Posted 2004) [#6]
Yeah, multiple cameras is the way to go to seperate world elements from HUD elements and so on. Makes it very simple to control it all.

Why Malice believes multiple cameras to be "quite slow", I don't know.


big10p(Posted 2004) [#7]
I guess he thought that would mean rendering all the geom twice?