Kaynağa Gözat

Renamed Light.ShadowsEnabled to Light.CastsShadow, ie: same as Model. Defaults to false now too.

Mark Sibly 8 yıl önce
ebeveyn
işleme
87562bd92b

+ 6 - 6
modules/mojo3d/graphics/deferredrenderer.monkey2

@@ -89,28 +89,28 @@ Class DeferredRenderer Extends Renderer
 		
 		'directional with shadows
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Directional Or Not light.ShadowsEnabled Continue
+			If light.Type<>LightType.Directional Or Not light.CastsShadow Continue
 			
 			RenderLight( light,camera )
 		Next
 		
 		'point with shadows (not supported yet)
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Point Or Not light.ShadowsEnabled Continue
+			If light.Type<>LightType.Point Or Not light.CastsShadow Continue
 			
 			RenderLight( light,camera )
 		Next
 		
 		'directional without  shadows
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Directional Or light.ShadowsEnabled Continue
+			If light.Type<>LightType.Directional Or light.CastsShadow Continue
 
 			RenderLight( light,camera )
 		Next
 		
 		'point without shadows
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Point Or light.ShadowsEnabled Continue
+			If light.Type<>LightType.Point Or light.CastsShadow Continue
 
 			RenderLight( light,camera )
 		Next
@@ -176,9 +176,9 @@ Class DeferredRenderer Extends Renderer
 		
 		Select light.Type
 		Case LightType.Directional
-			If light.ShadowsEnabled RenderCSMShadows( light ) ; pass|=2
+			If light.CastsShadow RenderCSMShadows( light ) ; pass|=2
 		Case LightType.Point
-			If light.ShadowsEnabled RenderPointShadows( light ) ; pass|=2
+			If light.CastsShadow RenderPointShadows( light ) ; pass|=2
 			pass|=1
 		End
 	

+ 6 - 6
modules/mojo3d/graphics/forwardrenderer.monkey2

@@ -91,25 +91,25 @@ Class ForwardRenderer Extends Renderer
 		_ambientRendered=False
 		
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Directional Or Not light.ShadowsEnabled Continue
+			If light.Type<>LightType.Directional Or Not light.CastsShadow Continue
 			
 			RenderOpaque( light,camera )
 		Next
 		
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Point Or Not light.ShadowsEnabled Continue
+			If light.Type<>LightType.Point Or Not light.CastsShadow Continue
 			
 			RenderOpaque( light,camera )
 		Next
 		
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Directional Or light.ShadowsEnabled Continue
+			If light.Type<>LightType.Directional Or light.CastsShadow Continue
 			
 			RenderOpaque( light,camera )
 		Next
 		
 		For Local light:=Eachin scene.Lights
-			If light.Type<>LightType.Point Or light.ShadowsEnabled Continue
+			If light.Type<>LightType.Point Or light.CastsShadow Continue
 			
 			RenderOpaque( light,camera )
 		Next
@@ -161,9 +161,9 @@ Class ForwardRenderer Extends Renderer
 		If light
 			Select light.Type
 			Case LightType.Directional			
-				if light.ShadowsEnabled RenderCSMShadows( light ) ; pass|=4
+				if light.CastsShadow RenderCSMShadows( light ) ; pass|=4
 			Case LightType.Point
-				if light.ShadowsEnabled RenderPointShadows( light ) ; pass|=4
+				if light.CastsShadow RenderPointShadows( light ) ; pass|=4
 				pass|=8
 			End
 			_runiforms.SetVec4f( "LightColor",light.Color )

+ 6 - 6
modules/mojo3d/graphics/light.monkey2

@@ -28,8 +28,8 @@ Class Light Extends Entity
 		
 		Type=LightType.Directional
 		Color=Color.White
-		Range=100
-		ShadowsEnabled=True
+		Range=10
+		CastsShadow=False
 		
 		Show()
 	End
@@ -47,13 +47,13 @@ Class Light Extends Entity
 	
 	#rem monkeydoc Light shadows enabled flag.
 	#end
-	Property ShadowsEnabled:Bool()
+	Property CastsShadow:Bool()
 		
-		Return _shadows
+		Return _castsShadow
 		
 	Setter( shadows:Bool )
 		
-		_shadows=shadows
+		_castsShadow=shadows
 	End
 	
 	#rem monkeydoc The light type.
@@ -123,6 +123,6 @@ Class Light Extends Entity
 	
 	Field _range:Float
 	
-	Field _shadows:bool
+	Field _castsShadow:bool
 
 End