Shadows on Mirror?

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
User avatar
Vertex
Posts: 108
Joined: Fri May 22, 2015 1:01 am
Location: Colombia
Contact:

Shadows on Mirror?

Post by Vertex » Fri Jul 03, 2015 4:00 am

Image

Which has left the shadow in the mirror and crown of light? :cry:
http://www.iris3dgames.com Reality Factory Spanish :wink:

Allanon
Posts: 493
Joined: Mon Aug 29, 2005 8:23 am

Re: Shadows on Mirror?

Post by Allanon » Fri Jul 03, 2015 6:17 am

Found this in the Genesis3d source code, doesn't look like RF supports shadows in mirrors:

Code: Select all

#pragma message ("BUG:  Shadow caused crash in mirrors (oops).  Need to write a RenderShadowThroughFrustum...")
	/*
	if (P->DoShadow)
		{
			gePuppet_DrawShadow(P,Engine,World,Camera);
		}
	*/

User avatar
aicd99
Posts: 264
Joined: Mon Oct 10, 2011 11:17 am

Re: Shadows on Mirror?

Post by aicd99 » Fri Jul 03, 2015 12:46 pm

Allanon wrote:Found this in the Genesis3d source code, doesn't look like RF supports shadows in mirrors:

Code: Select all

#pragma message ("BUG:  Shadow caused crash in mirrors (oops).  Need to write a RenderShadowThroughFrustum...")
	/*
	if (P->DoShadow)
		{
			gePuppet_DrawShadow(P,Engine,World,Camera);
		}
	*/
If you fix it up that would be new update on the engine that could be used on the final version a new reality factroy

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Shadows on Mirror?

Post by QuestOfDreams » Fri Jul 03, 2015 2:12 pm

Allanon wrote:Found this in the Genesis3d source code, doesn't look like RF supports shadows in mirrors:

Code: Select all

#pragma message ("BUG:  Shadow caused crash in mirrors (oops).  Need to write a RenderShadowThroughFrustum...")
	/*
	if (P->DoShadow)
		{
			gePuppet_DrawShadow(P,Engine,World,Camera);
		}
	*/
Actually, that's not the code for shadow volumes. The code in question is in the function RenderShadowVolumes in world.c:

Code: Select all

	// no shadows in mirrors for now...
	if(MirrorRecursion > 0)
		return GE_TRUE;
I think I originally disabled it due to performance reasons but I don't remember if I've ever tested shadow volume rendering for mirrors.

User avatar
Vertex
Posts: 108
Joined: Fri May 22, 2015 1:01 am
Location: Colombia
Contact:

Re: Shadows on Mirror?

Post by Vertex » Fri Jul 03, 2015 4:13 pm

There is a possibility that in the future this option will be provided so you can enable or disable .
http://www.iris3dgames.com Reality Factory Spanish :wink:

Veleran
Posts: 891
Joined: Mon Aug 22, 2005 10:22 am
Location: Greece

Re: Shadows on Mirror?

Post by Veleran » Fri Jul 03, 2015 10:40 pm

You would have to do very careful level design,to know when the mirror comes in view and when it is not.
Now ,when the mirror comes in view,you may not see it but if there are walls in front of it,but it will still double the polycount and shadows calculations.

One way is keep performance up is to stop from rendering any polygons that are inside closed rooms using sealed areas and area flagged portal brushes at the door positions (with a smaller hint door in the middle to allow passing through).

You can also use far clip plane and fog but i know you will want to set this distance limit to high so you see far as possible,and it means that the mirror will be so small you will not even notice it from far but it will be rendered by the engine and ,might mess the framerate.

I just thought a trick for this that is much easier than the whole area portals settup:
If all shadows were enabled for the mirrors in the source code, you could try making a moving platform mirror that stays out of sight at a far corner of the level and when you go near the supposed mirror position,a trigger makes the moving model to move front of a fake mirror you have put and then all can be reflected.

When you move away from the mirror,it will fly back out of sight and keep the performance high.
I have not tested it yet but in theory it should work,unless moving platforms can not be mirrors.

Post Reply