/// <summary> /// Called when loader finished loading. /// This method lets client to complete loading process in main thread. /// </summary> /// <param name="loader"></param> public override void FinalizeLoad( GameLoader loader ) { var shooterLoader = (ShooterLoader)loader; gameWorld = shooterLoader.World; gameWorld.FinalizeLoad(); gameWorld.ReplicaSpawned += ( s, e ) => { if ( e.Entity.UserGuid==Guid) { UserCommand.Yaw = 0; UserCommand.Pitch = 0; UserCommand.Roll = 0; UserCommand.CtrlFlags = UserCtrlFlags.None; } }; var rw = Game.RenderSystem.RenderWorld; rw.VirtualTexture = Content.Load<VirtualTexture>( "test" ); rw.HdrSettings.BloomAmount = 0.1f; rw.HdrSettings.DirtAmount = 0.0f; rw.HdrSettings.KeyValue = 0.18f; rw.SkySettings.SunPosition = new Vector3( 1.2f, 1.4f, 1.3f ); rw.SkySettings.SunLightIntensity = 100; rw.SkySettings.SkyTurbidity = 8; rw.LightSet.DirectLight.Direction = rw.SkySettings.SunLightDirection; rw.LightSet.DirectLight.Intensity = rw.SkySettings.SunLightColor; rw.LightSet.AmbientLevel = rw.SkySettings.AmbientLevel; rw.LightSet.SpotAtlas = Content.Load<TextureAtlas>(@"spots\spots"); /*for (int i=0; i<1; i++) { var spot = new SpotLight(); spot.SpotView = Matrix.LookAtRH( new Vector3( 8, 10, 7 ), Vector3.Zero, Vector3.Up ); spot.Intensity = new Color4( 500, 500, 500, 1 ); spot.Projection = Matrix.PerspectiveRH( 0.1f, 0.1f, 0.1f, 100 ); spot.RadiusOuter = 100; spot.TextureIndex = 0; rw.LightSet.SpotLights.Add( spot ); } */ //rw.LightSet.EnvLights.Add( new EnvLight( new Vector3(0,4,0), 1, 500 ) ); /*for (float x=-32; x<=32; x+=16 ) { for (float y=-32; y<=32; y+=16 ) { rw.LightSet.EnvLights.Add( new EnvLight( new Vector3(x,4,y), 1, 16 ) ); } } */ Log.Message("Capturing radiance..."); rw.RenderRadiance(); (Game.UserInterface as ShooterInterface).ShowMenu = false; Log.Message("---- Loading game completed ----"); Log.Message(""); }