Announcement

Collapse
No announcement yet.

Drivable Vehicle and Walking Ped ( Skltl Mesh)Are Dark When in shadow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Drivable Vehicle and Walking Ped ( Skltl Mesh)Are Dark When in shadow

    I have an interesting problem. A vehicle and a pedesterian skeletal mesh are both lit when they are put on the map from content browser, but when i put the car from actor classes , and make the ped walking from gamecrowd agent , they both become dark in shadows

    Here are screens to showcase the issue

    the pedesterian
    http://i.imgur.com/jKa5b.jpg

    the vehicle

    http://i46.tinypic.com/25fho35.jpg

    Both models are free downloads not my work.

    Is the problem about dominant directional light movable?

    #2
    created physics assets and made sure they have lightenvironments (defined either in their class or one of the supers depending on where you extended from)?

    Comment


      #3
      Originally posted by Jetfire View Post
      created physics assets and made sure they have lightenvironments (defined either in their class or one of the supers depending on where you extended from)?
      they both have physic asset. But i dont know about light environment. How can i exactly do it. Thanks in advance

      Comment


        #4
        Yeah, properly configured light environments will probably fix that. If the objects are placed in the editor you can simply enable them in the properties of the object. If you spawn them in-game you should take a look at the default properties of the character or vehicle classes in UT, their lightenvironment are defined there.

        Comment


          #5
          also there is a tick box in the crowd agent to enable the light environment.

          Comment


            #6
            thank you tegleg now the ped is lit. But the drivable vehicle is not. How can i enable light environment of it. When i spawn the car from actor classes , there is no light environment option in properties.

            Comment


              #7
              you need to add it in the defaultproperties in the script.
              taken from UTVehicle.uc
              Code:
              /** The pawn's light environment */
              var DynamicLightEnvironmentComponent LightEnvironment;
              ....
              DefaultProperties
              {
              Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
              		bSynthesizeSHLight=true
              		bUseBooleanEnvironmentShadowing=FALSE
              	End Object
              	LightEnvironment=MyLightEnvironment
              	Components.Add(MyLightEnvironment)
              
              	Begin Object Name=SVehicleMesh
              		CastShadow=true
              		bCastDynamicShadow=true
              		LightEnvironment=MyLightEnvironment
              		bOverrideAttachmentOwnerVisibility=true
              		bAcceptsDynamicDecals=FALSE
              		bPerBoneMotionBlur=true
              	End Object

              Comment


                #8
                hmm compiling is stuck in analyizng for 10 minutes. is it normal?

                by the way this is the vehicle code when i copied the code above

                Code:
                // lets exend SVehicle and make our own custom vehicle class
                
                class alfa8cfinal extends SVehicle;
                
                 /** The pawn's light environment */
                var DynamicLightEnvironmentComponent LightEnvironment;
                simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
                {
                	local vector X, Y, Z;
                
                    //this makes the camera stay with the vehicle
                	GetActorEyesViewPoint( out_CamLoc, out_CamRot );
                
                	    GetAxes(Rotation,X,Y,Z);
                
                	    // a bit behind
                		out_CamLoc = Location - 300 * X;
                		//up a bit
                		out_CamLoc.Z = Location.Z + 150;
                
                    //camera rotation yaw = vehicle rotation yaw
                	out_CamRot.Yaw = Rotation.Yaw;
                	//  look down a bit
                	//delete this line if you want the cam to roll with the vehicle
                	out_CamRot.Roll = 0;
                
                	return true;
                }
                
                
                
                
                DefaultProperties
                {
                Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
                		bSynthesizeSHLight=true
                		bUseBooleanEnvironmentShadowing=FALSE
                	End Object
                	LightEnvironment=MyLightEnvironment
                	Components.Add(MyLightEnvironment)
                
                	Begin Object Name=SVehicleMesh
                		CastShadow=true
                		bCastDynamicShadow=true
                		LightEnvironment=MyLightEnvironment
                		bOverrideAttachmentOwnerVisibility=true
                		bAcceptsDynamicDecals=FALSE
                		bPerBoneMotionBlur=true
                	End Object
                
                 
                 //  parameters for player to flip vehicle
                 UprightLiftStrength=280.0
                 UprightTime=1.25
                 UprightTorqueStrength=500.0
                 bCanFlip=true
                 
                 bHasHandbrake=true
                 GroundSpeed=1500   // max speed on ground
                 AirSpeed=1700  // max speed in air
                 HeavySuspensionShiftPercent=0.75f;
                 
                // define the vehicle simulation
                Begin Object Class=UDKVehicleSimCar Name=SimObject
                 
                 WheelSuspensionStiffness=80.0  //how soft the suspension is
                 WheelSuspensionDamping=3.0
                 WheelSuspensionBias=0.1
                 ChassisTorqueScale=0.0
                 MaxBrakeTorque=5.0
                 StopThreshold=100
                 
                 MaxSteerAngleCurve=(Points=((InVal=0,OutVal=45),(InVal=600.0,OutVal=15.0),(InVal=1100.0,OutVal=10.0),(InVal=1300.0,OutVal=6.0),(InVal=1600.0,OutVal=1.0)))
                 SteerSpeed=110
                 
                 LSDFactor=0.0
                 
                 // The follow two parameters set the gear rangers (in rpm) and the torque produced per range
                 TorqueVSpeedCurve=(Points=((InVal=-600.0,OutVal=0.0),(InVal=-300.0,OutVal=80.0),(InVal=0.0,OutVal=130.0),(InVal=950.0,OutVal=130.0),(InVal=1050.0,OutVal=10.0),(InVal=1150.0,OutVal=0.0)))
                 EngineRPMCurve=(Points=((InVal=-500.0,OutVal=2500.0),(InVal=0.0,OutVal=500.0),(InVal=549.0,OutVal=3500.0),(InVal=550.0,OutVal=1000.0),(InVal=849.0,OutVal=4500.0),(InVal=850.0,OutVal=1500.0),(InVal=1100.0,OutVal=5000.0)))
                 
                 EngineBrakeFactor=0.025
                 ThrottleSpeed=0.2
                 WheelInertia=0.2
                 NumWheelsForFullSteering=4
                 SteeringReductionFactor=0.0
                 SteeringReductionMinSpeed=1100.0
                 SteeringReductionSpeed=1400.0
                 bAutoHandbrake=true
                 bClampedFrictionModel=true
                 FrontalCollisionGripFactor=0.18
                 ConsoleHardTurnGripFactor=1.0
                 HardTurnMotorTorque=0.7
                 
                 SpeedBasedTurnDamping=20.0
                 AirControlTurnTorque=40.0
                 InAirUprightMaxTorque=15.0
                 InAirUprightTorqueFactor=-30.0
                 
                 // Longitudinal tire model based on 10% slip ratio peak
                 WheelLongAsymptoteSlip=2.0
                 WheelLongAsymptoteValue=0.6
                 
                 // Lateral tire model based on slip angle (radians)
                    WheelLatExtremumSlip=0.35     // 20 degrees
                 WheelLatExtremumValue=0.9
                 WheelLatAsymptoteSlip=1.4     // 80 degrees
                 WheelLatAsymptoteValue=0.9
                 
                 bAutoDrive=false
                 AutoDriveSteer=0.3
                End Object
                 
                SimObj=SimObject
                Components.Add(SimObject)
                
                Begin Object Class=AudioComponent Name=ScorpionEngineSound
                		SoundCue=SoundCue'A_Vehicle_Scorpion.SoundCues.A_Vehicle_Scorpion_EngineLoop'
                	End Object
                	EngineSound=ScorpionEngineSound
                	Components.Add(ScorpionEngineSound);
                
                	Begin Object Class=AudioComponent Name=ScorpionTireSound
                		SoundCue=SoundCue'A_Vehicle_Generic.Vehicle.VehicleSurface_TireDirt01Cue'
                	End Object
                	Components.Add(ScorpionTireSound);
                
                
                
                
                // Wheel squealing sound.
                	Begin Object Class=AudioComponent Name=ScorpionSquealSound
                		SoundCue=SoundCue'A_Vehicle_Scorpion.SoundCues.A_Vehicle_Scorpion_Slide'
                	End Object
                	SquealSound=ScorpionSquealSound
                	Components.Add(ScorpionSquealSound);
                
                	CollisionSound=SoundCue'A_Vehicle_Scorpion.SoundCues.A_Vehicle_Scorpion_Collide'
                	EnterVehicleSound=SoundCue'A_Vehicle_Scorpion.SoundCues.A_Vehicle_Scorpion_Start'
                	ExitVehicleSound=SoundCue'A_Vehicle_Scorpion.SoundCues.A_Vehicle_Scorpion_Stop'
                SquealThreshold=0.1
                	SquealLatThreshold=0.02
                	LatAngleVolumeMult = 30.0
                	EngineStartOffsetSecs=2.0
                	EngineStopOffsetSecs=1.0
                
                
                 
                // define the vehicle mesh, animation tree, and physics asset 
                Begin Object Name=SVehicleMesh
                 SkeletalMesh=SkeletalMesh'alfa8cpackage.alfa8cfinal'
                 AnimTreeTemplate=AnimTree'alfa8cpackage.AT_alfa8cfinal'
                 PhysicsAsset=PhysicsAsset'alfa8cpackage.alfa8cfinal_Physics'
                End Object
                 
                // define all the wheels 
                
                Begin Object Class=SVehicleWheel Name=FLWheel
                 BoneName="Alfa_Whl_LHF"
                 SkelControlName="Alfa_Whl_LHF_CTRL"
                 WheelRadius=22
                 SteerFactor=1.0
                 LongSlipFactor=2.0
                 LatSlipFactor=3.0
                 HandbrakeLongSlipFactor=0.8
                 HandbrakeLatSlipFactor=0.8
                End Object
                Wheels(0)=FLWheel
                
                Begin Object Class=SVehicleWheel Name=FRWheel
                 BoneName="Alfa_Whl_RHF"
                 SkelControlName="Alfa_Whl_RHF_CTRL"
                 WheelRadius=22
                 SteerFactor=1.0
                 LongSlipFactor=2.0
                 LatSlipFactor=3.0
                 HandbrakeLongSlipFactor=0.8
                 HandbrakeLatSlipFactor=0.8
                End Object
                Wheels(1)=FRWheel
                 
                
                 
                Begin Object Class=SVehicleWheel Name=RRWheel
                 BoneName="Alfa_Whl_RHR"
                 SkelControlName="Alfa_Whl_RHR_CTRL"
                 WheelRadius=22
                 bPoweredWheel=true
                End Object
                Wheels(2)=RRWheel
                 
                Begin Object Class=SVehicleWheel Name=RLWheel
                 BoneName="Alfa_Whl_LHR"
                 SkelControlName="Alfa_Whl_LHR_CTRL"
                 WheelRadius=22
                 bPoweredWheel=true
                End Object
                Wheels(3)=RLWheel
                 
                }

                Comment


                  #9
                  you have sVehicleMesh declared twice
                  just add the lightenvironment bit to the one where your skelital mesh is

                  Comment


                    #10
                    edit: i just did it thanks a lot. I had this problem like for a month

                    Comment


                      #11
                      edit: thank i did it

                      Comment

                      Working...
                      X