Resolved - Portal no render player 3rd person
by Steve Acaster · in Torque 3D Professional · 07/07/2009 (8:43 am) · 16 replies
When the player is standing in a portal, the player will not render whilst in 3rd person. Player renders fine in 1st person. Player re-renders in 3rd person as soon as player moves out of portal and into a zone (or out of zones/portals all together).
This also happens for the moment when the player moves across the edge of a zone. eg: out of a zone not using a portal, just stepping into the zone boundary. Once across the zone boundary the player re-renders in 3rd person.
Other issues:
Skybox and sunobjects don't render through a zone.
Mulitple meshed DTS models don't cull individual sub-meshes (but you knew that already, you told me about it)
Lighting and Shadows don't cull - I have no idea how difficult this would be to implement but I've got a feeling the answer is very.
Had a play in Beta5 and this seems to have been sorted. Moving to Resolved.
This also happens for the moment when the player moves across the edge of a zone. eg: out of a zone not using a portal, just stepping into the zone boundary. Once across the zone boundary the player re-renders in 3rd person.
Other issues:
Skybox and sunobjects don't render through a zone.
Mulitple meshed DTS models don't cull individual sub-meshes (but you knew that already, you told me about it)
Lighting and Shadows don't cull - I have no idea how difficult this would be to implement but I've got a feeling the answer is very.
Had a play in Beta5 and this seems to have been sorted. Moving to Resolved.
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#2
07/07/2009 (10:25 pm)
Quote:Yeah, I think sub-mesh culling is something T3D needs in order to further the usage of collada as level geometry.The pipeline for that is in place... its a performance optimization i plan to do soon before we ship.
#3
In the _traverseZones() function, right under these to lines:
put this
07/09/2009 (2:23 pm)
@Steve, can you do me a favor and test this small change to SceneRoot::_traverseZones() to see if it fixes your 3rd person player rendering issue?In the _traverseZones() function, right under these to lines:
if ( !currFrustum.intersectOBB( portal->getOBBPoints() ) )
continue;put this
SceneState::ZoneState &portalState = state->getZoneStateNC( portal->getZoneRangeStart() );
portalState.render = true;
#4
edit:
Incidentally, is there a thickness/depth/Y-axis that the portal should be? I noticed it starts at 0.25 (Y axis), but that's as fiddly as hell to try and align 2 zones between.
07/09/2009 (3:12 pm)
No, I'm not seeing change after the recompile.edit:
Incidentally, is there a thickness/depth/Y-axis that the portal should be? I noticed it starts at 0.25 (Y axis), but that's as fiddly as hell to try and align 2 zones between.
#5
If possible, could you send me your mission file so I can test my fixes there? (You can send it to ross AT sickheadgames DOT com).
07/13/2009 (2:59 pm)
Yeah you should definitely increase the thickness so that it overlaps into whatever zones you need it to connect to. The portal itself should behave as a zone, so you don't have to line them up perfectly.If possible, could you send me your mission file so I can test my fixes there? (You can send it to ross AT sickheadgames DOT com).
#6
07/13/2009 (5:26 pm)
Just checking that I was supposed to make them thicker, which I had done.
#7
In Zone::_traverseZones() right before
put this
Which just tells the portal to set items within itself to be renderable if the camera is inside the zone (things will still be culled by the frustum set on the portal's zonestate). Let me know if that helps for you.
07/16/2009 (9:22 am)
@Steve, so I tested out your mission and I know why my previous fix didn't work for you. Try this:In Zone::_traverseZones() right before
//
if ( !currFrustum.intersectOBB( portal->getOBBPoints() ) )
continue;put this
//
if ( portal->getPointZone( frust.getPosition() ) )
{
SceneState::ZoneState &portalState = state->getZoneStateNC( portal->getZoneRangeStart() );
portalState.render = true;
}Which just tells the portal to set items within itself to be renderable if the camera is inside the zone (things will still be culled by the frustum set on the portal's zonestate). Let me know if that helps for you.
#8
07/16/2009 (10:56 am)
@Steve, out of curiosity, is that mission just a test, or are you trying to break up your open area with zones/portals?
#9
I stuck your original code in the wrong place.
Luckily for my arse, there was still an issue with 3rd person rendering when I righted this cockup. So I didn't send you off on a wild goose chase. (albeit by sheer fluke rather than craft)
Secondly:
The new code seems to work fine. 3rd person renders all the time when in a portal.
The problem with the original code (apart from my inability to understand the difference between pasting it above to below) was that when running against the (I think it's the) world X axis, the player would still vanish at teh further end of a portal (portal orientated along X axis).
This doesn't seem occur with the new code replacing the old. So it all seems good.
I'll do more testing, and try and read where to put things properly in future.
edit: That one was just a test
07/16/2009 (11:44 am)
First up, a confession:I stuck your original code in the wrong place.
Luckily for my arse, there was still an issue with 3rd person rendering when I righted this cockup. So I didn't send you off on a wild goose chase. (albeit by sheer fluke rather than craft)
Secondly:
The new code seems to work fine. 3rd person renders all the time when in a portal.
The problem with the original code (apart from my inability to understand the difference between pasting it above to below) was that when running against the (I think it's the) world X axis, the player would still vanish at teh further end of a portal (portal orientated along X axis).
This doesn't seem occur with the new code replacing the old. So it all seems good.
I'll do more testing, and try and read where to put things properly in future.
edit: That one was just a test
#11
07/16/2009 (1:56 pm)
@Steve, if you're able to, any additional testing you can do for this and any other weird cases you've seen would be much appreciated. The zone/portals are relatively hard to catch corner cases for, from what I've seen setting them up.
#12
07/16/2009 (1:57 pm)
Okeedokee
#13
When a portal is aligned along the X axis, and the player is not in the portal but in one of the 2 connecting zones objects on the "plus" side of the X axis of the portal do not render from either direction/zone. If the player steps into the portal from either direction the models will render.
I have rotated my portals along the axis so that they appear to face the flat green plane in the centre towards the 2 zones. However even if I do not rotate the portals so that the green central plane cuts into both zones, the results are the same.
edit:
Also objects will not render if viewed through the Y axis side of the portal whilst it is at rotation "1 0 0 0" if the centre green pane is horizontally touching into each zone rather than facing them. Facing them and no probs on this.
edit2:
Messing with the working "normally" Y axis facing causes problems. Rotating the green plane to intersect with the zones and to be looking down the X axis heading to positives, everything renders in portals but not in the zone beyond, and looking back down (negative) X axis nothing will render in portal or zone beyond. Leaving Y axis facing portals alone and everything seems good for them.
I hope this all made sense - and the player does render in 3rd person at all times which is win.
07/16/2009 (2:46 pm)
Okay, I think I've found an issue and isolated it's action.When a portal is aligned along the X axis, and the player is not in the portal but in one of the 2 connecting zones objects on the "plus" side of the X axis of the portal do not render from either direction/zone. If the player steps into the portal from either direction the models will render.
I have rotated my portals along the axis so that they appear to face the flat green plane in the centre towards the 2 zones. However even if I do not rotate the portals so that the green central plane cuts into both zones, the results are the same.
edit:
Also objects will not render if viewed through the Y axis side of the portal whilst it is at rotation "1 0 0 0" if the centre green pane is horizontally touching into each zone rather than facing them. Facing them and no probs on this.
edit2:
Messing with the working "normally" Y axis facing causes problems. Rotating the green plane to intersect with the zones and to be looking down the X axis heading to positives, everything renders in portals but not in the zone beyond, and looking back down (negative) X axis nothing will render in portal or zone beyond. Leaving Y axis facing portals alone and everything seems good for them.
I hope this all made sense - and the player does render in 3rd person at all times which is win.
#14
07/16/2009 (3:16 pm)
@Steve, mind sending me a test mission with those cases? :P
#15
Apart from the treestest1.mis I sent you - which I ripped from custom anyhow, all my stuff is custom, and doesn't "fit in the post", way too much mb. I'll strip it down, give it a test and send post IRC.
edit:
sent
You've got the biggest untextured model the world has seen but it should work. ;)
07/16/2009 (3:43 pm)
I'll see if I can cut my stuff down somehow, or retrofit it to stock.Apart from the treestest1.mis I sent you - which I ripped from custom anyhow, all my stuff is custom, and doesn't "fit in the post", way too much mb. I'll strip it down, give it a test and send post IRC.
edit:
sent
You've got the biggest untextured model the world has seen but it should work. ;)
#16
Whilst the player shows up inside the portals in 3rd person, objects won't be viewable from outside the portal (but still in a zone), unless part of the objects bounds is touching a zone.
So, keep portals thin(ish) so that they don't swallow objects whole should work.
I think ...
07/26/2009 (8:27 pm)
Okeedokee, been trying this in B4.Whilst the player shows up inside the portals in 3rd person, objects won't be viewable from outside the portal (but still in a zone), unless part of the objects bounds is touching a zone.
So, keep portals thin(ish) so that they don't swallow objects whole should work.
I think ...
Associate Manoel Neto
Default Studio Name
Yeah, I think sub-mesh culling is something T3D needs in order to further the usage of collada as level geometry. Back in TGEA, when I rolled my own FBX-based interior replacement I used r-trees to store sub-meshes and do the culling. T3D's opcode AABB trees are essentially the same thing, and could be used.
Well, that's a no-brainer. You might not be looking at a portal placed in a window, but you might be seeing the light cast through it and the shadows of whatever objects you have outside that might be cast through the window. Since rendering the shadow buffer is the cheapest part of the entire process, I think trying to do any kind of culling would en up being more expensive, since it would involve generating shadow volumes and testing those against the portals or something like that. *Maybe* for player bounding boxes, since it would skip them from updating their skin.