Elvas Tower: DYNAMIC SHADOWS RENDERING. - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

DYNAMIC SHADOWS RENDERING. Rate Topic: -----

#1 User is offline   vince 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,312
  • Joined: 18-June 14
  • Gender:Male
  • Location:West of the Contental Divide
  • Simulator:ORTS_Running MSTS_Editing
  • Country:

Posted 06 October 2016 - 01:25 PM

Greetings,
What determines whether or not a shadow is displayed on a shape? A static object like a train platform for example.
de_ELOldSta_spec_Platf.S shape won't show a dynamic shadow that is cast on it by the tree out of sight to the right.
There is what appears to be some sort of shadow near the lamp post.
It's only the join point between two platform sections and also the fence railing should be casting it's shadow on the platform.Attached Image: DYNSHADNOT.jpg
Is there something in the shape file I should look for?
And also: What determines whether or not a shape casts a shadow?

regards,
vince

#2 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 06 October 2016 - 01:32 PM

The platform probably uses self illuminated material (Tex) which ignores all lighting conditions.

#3 User is offline   Lindsayts 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,849
  • Joined: 25-November 11
  • Gender:Male
  • Country:

Posted 06 October 2016 - 01:56 PM

Doing shadows in a scene is VERY difficult and CPU and GPU intensive. To generate a shadow the scene is rendered twice once to do the scenes lighting the next to render the shadows. Shadows are only rendered on to the ground as this is the simplest target to access. To render a shadow on another object means you have to detect the object will be in the shadows path, thus collision detection is required, another very resource hungry service. Also the object with the shadow cast on it, will most likely need another lighting pass. Its just to complex and resource hungry.

Generating any kind of realistic imagery is VERY VERY VERY difficult. In all simulations you MUST make the effort being in the sim as it will always be to much to difficult to create true to life scenes.

Hope this makes sense, if anyone has any questions please ask.

Lindsay

#4 User is offline   Goku 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,785
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 06 October 2016 - 02:09 PM

Lindsay, you are wrong :) As you can see on the image above, shadow is on other objects too. Today all games use Shadow Maps and it is very easy to render shadow on everything:
http://www.opengl-tu...shadow-mapping/

It is true that the scene has to be rendered at least twice.

#5 User is offline   vince 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,312
  • Joined: 18-June 14
  • Gender:Male
  • Location:West of the Contental Divide
  • Simulator:ORTS_Running MSTS_Editing
  • Country:

Posted 06 October 2016 - 05:13 PM

View Postdisc, on 06 October 2016 - 01:32 PM, said:

The platform probably uses self illuminated material (Tex) which ignores all lighting conditions.

http://www.elvastower.com/forums/public/style_emoticons/default/sign_sorry.gif about responding so late.
I quite simply forgot as I am working hard to get the Long Island Rail Road route ready for the Public Beta release. Route editing is done but some of the activities out of the 18 in total are giving me fits.

That aside, here are two pictures and a clip of the 2 shape files in question.
One renders shadows correctly while the other does not.
Attached two pics and a text of the top of both shape files.
MSTS ROUTE EDITOR
Attached Image: DYN SHAD RE (Custom).jpg

OPEN RAILS
Attached Image: DYN SHAD  OR (Custom).jpg
OR view distance set to 2 kilometers.

The only difference I see in the shape files beside the shape itself is the shader_names line.
The one that does not show shadows has BlenATex while the one that shows shadows has TexDiff as named_shader.
THIS IS THE PLATFORM THAT DOES NOT SHOW A SHADOW CAST UPON IT.
de_ELOldSta_spec_Platf.s
SIMISA@@@@@@@@@@JINX0s1t______

shape (
	shape_header ( 00000000 00000000 )
	volumes ( 1
		vol_sphere (
			vector ( 0.0334625 0.573157 1.43051e-006 ) 12.8977
		)
	)
	shader_names ( 1
		named_shader ( BlendATex )
	)
	texture_filter_names ( 1
		named_filter_mode ( MipLinear )
	)
	points ( 34
		point ( -12.5876 0.657064 2.52 )
		point ( -12.5876 -0.269036 2.52 )
		point ( 0.0123811 -0.269036 2.52 )
		point ( 0.0123811 0.657064 2.52 )
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AND THIS IS THE PLATFORM I MADE IN GSU THAT DOES SHOW A SHADOW CAST UPON IT.
LIRR_Platform_Employee_50m.s
SIMISA@@@@@@@@@@JINX0s1t______

shape (
	shape_header sketchup11 ( 00000000 00000000 )
	volumes ( 1
		vol_sphere (
			vector ( 0 0.435 24.5 ) 25.0552
		)
	)
	shader_names ( 1
		named_shader ( TexDiff )
	)
	texture_filter_names ( 1
		named_filter_mode ( MipLinear )
	)
	points ( 16
		point ( -1.5 0.9 -0.5 )
		point ( -1 0.9 49 )
		point ( -1.5 0.9 49.5 )
		point ( 1.5 0.9 49.5 )
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

best regards,
vince

#6 User is offline   Lindsayts 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,849
  • Joined: 25-November 11
  • Gender:Male
  • Country:

Posted 06 October 2016 - 11:27 PM

View PostGoku, on 06 October 2016 - 02:09 PM, said:

Lindsay, you are wrong :) As you can see on the image above, shadow is on other objects too. Today all games use Shadow Maps and it is very easy to render shadow on everything:
http://www.opengl-tu...shadow-mapping/

It is true that the scene has to be rendered at least twice.


I agree that its not true colliision detection on the 2nd pass, but the Z buffer is checked for every pixel to see if something is between it and the light source and therefore the pixel is in shadow, this means its just another thing for the GPU to do.

You see I cut my teeth on computor game graphics by writing (In Motorola M68K assembly language) many years ago a very fast game routines library for others to use, for instance the bit blit routine could handle areas 2 to 8 pixels wide (we are talking 16 colours here, this was in the early 1990's) and from 4 to 32 lines deep and had only ONE conditional test in the whole 108kilobytes of the final assembled routine, this routine was 20 times faster than the existing bit blit routine due to its "inline" nature (ie no loops). As a consequence I still look out for any possible unnecesary processing.

#7 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,307
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 16 October 2016 - 10:06 AM

Q: WRT workload, is shadow processing entirely a GPU function or is it shared in some significant percentage with the CPU? What I'm trying to learn here is what effect upon performance will additional shadow maps have when the processing is already CPU bound and the PC has a fairly powerful GPU installed.

#8 User is offline   Goku 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,785
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 16 October 2016 - 10:16 AM

Dynamic shadows require at least one scene rendering from light source point of view, so it needs CPU power. How much, it depends on how much CPU is used for scene rendering. For example, my app is not optimized for multiple scene rendering, so it uses significant percentage of CPU.

#9 User is offline   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,488
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 16 October 2016 - 01:21 PM

View PostGenma Saotome, on 16 October 2016 - 10:06 AM, said:

Q: WRT workload, is shadow processing entirely a GPU function or is it shared in some significant percentage with the CPU? What I'm trying to learn here is what effect upon performance will additional shadow maps have when the processing is already CPU bound and the PC has a fairly powerful GPU installed.

As it currently stands, everything which casts a shadow must be rendered 5 times - once for the screen, and once for each of the 4 shadow maps. The shadow map rendering isn't the same level of CPU or GPU work as the screen rendering (the shader is much simpler, for example) but it's still 5x the draw calls. So it increases CPU and GPU similarly. There should be ways to optimise this with e.g. multiple render targets, but they've not been investigated yet.

Note that what receives shadows has little to no effect on rendering effort (it costs a tiny bit of GPU and no CPU).

#10 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,307
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 16 October 2016 - 03:39 PM

View PostJames Ross, on 16 October 2016 - 01:21 PM, said:

As it currently stands, everything which casts a shadow must be rendered 5 times - once for the screen, and once for each of the 4 shadow maps.


How unfortunate. Yet another reason to hope the OR code can successfully make its way to multi-threaded rendering.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users