Hide Entity from specific Camera

Blitz3D Forums/Blitz3D Programming/Hide Entity from specific Camera

LamptonWorm(Posted 2008) [#1]
Hi all,

Aapart from using the RenderWorld twice trick which I imagine will slow things up... is there a way to hide an entity from the view of a specified camera?

I'm working on a split screen FPS game and I want a command such as HideEntity(EntityID,CameraID) to hide say P1 from P1's camera.

Also useful for 3d hud objects and weapons (e.g. P1 Cam may just show hand + weapon, and hide the model the other players Cameras can see).

Cheers,
LW.


GfK(Posted 2008) [#2]
You can't hide entities from individual cameras.

You can either move the HUD camera away from the main camera, or call renderworld twice with each camera/bunch of objects hidden. You need to use CameraClsMode on the second camera so that the render from the first camera doesn't get wiped out when you call Renderworld the second time.


LamptonWorm(Posted 2008) [#3]
Thanks, sounds like that's the way to go. Or maybe I'll go for 'over the shoulder' cam and pure 2d hud then I don't have to worry about this in the first place ;)

Cheers,
LW.


Ross C(Posted 2008) [#4]
If your using two cameras:

Show camera 1
Hideentity
Renderworld
Hide camera 1

Show camera 2
Showentity
renderworld

If you are using 2 cameras, you will be rendering the scene twice anyway, so, no slowdown is incurred. Make sure though you don't clear the colour buffer between renders :o)


Shambler(Posted 2008) [#5]
You could just parent the entity to the camera you want it visible on, then it will get hidden/shown automatically with the camera.


Ross C(Posted 2008) [#6]
What if the camera moves :o)


Shambler(Posted 2008) [#7]
IF it is a HUD it doesn't generally move ;)


LamptonWorm(Posted 2008) [#8]
Ta for the info all, I'll have a go with this later.

Cheers,
LW.


GfK(Posted 2008) [#9]
Don't use a 2D HUD over 3D.

Why? Because you will encounter all manner of problems when you come to try running your game in different resolutions. You don't have to worry about this if you do it all in 3D.


Ross C(Posted 2008) [#10]
Sorry again, i didn't read he was wanting this for a 3d hud. my bad!