public bool Init(RenderingScene renderingScene) { try { var skyboxName = RenderAPI.I.Game.Level.LevelInfo["LevelProperties", "Skybox"]; var skyboxData = RenderAPI.I.Game.Level.LevelInfo[skyboxName]; _skybox = Skybox.Load( skyboxData["right"], skyboxData["left"], skyboxData["top"], skyboxData["bottom"], skyboxData["back"], skyboxData["front"]); initialized = true; scene = renderingScene; } catch (Exception e) { RenderAPI.I.Core.Log.Error("Can't load skybox", e); #if DEBUG throw; #endif initialized = false; } return(initialized); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); model = Content.Load <Model>(@"Models\sphere0"); skybox.Load(@"Skyboxes\skybox2"); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. SpriteBatch = new SpriteBatch(GraphicsDevice); Skybox.Load(@"Skyboxes\skybox"); Font = Content.Load <SpriteFont>(@"Fonts\Arial"); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); fps.Load(spriteBatch); model = Content.Load <Model>(@"Models\asteroid1"); texture = Content.Load <Texture2D>(@"Textures\asteroid1"); effect = Content.Load <Effect>(@"Effects\AmbientTexture"); effect.Parameters["AmbientColor"].SetValue( Color.WhiteSmoke.ToVector4()); //skybox = Content.Load<Skybox>(@"Skyboxes\skybox2"); skybox.Load(@"Skyboxes\skybox2"); base.LoadContent(); }
protected override void LoadContent() { _spriteBatch = new SpriteBatch(GraphicsDevice); CurrentProject.GraphicsDevice = GraphicsDevice; CurrentProject.SkyboxShader.LoadShader(Content, GraphicsDevice); CurrentProject.TexturedMeshShader.LoadShader(Content, GraphicsDevice); CurrentProject.BasicColorShader.LoadShader(Content, GraphicsDevice); CurrentProject.Resolution = new Vector2(800, 600); CurrentProject.BasicColorShader.LoadShader(Content, GraphicsDevice); Skybox.Load(Content); Space = new BEPUphysics.Space(); Space.ForceUpdater.Gravity = new BEPUutilities.Vector3(0, -9f, 0); Space.ForceUpdater.Enabled = true; Map.Load(Content); MapVisible.Load(Content); SetDefaultSkinmeshLightning(MapVisible.Model); Map.PhysicsInitialize(Space); StairsVisible.Load(Content); SetDefaultSkinmeshLightning(StairsVisible.Model); Stairs.Load(Content); Stairs.PhysicsInitialize(Space); Teapot.Load(Content); Cup.Load(Content); Camera.PhysicsInitialize(Space); Skybox.LinkCamera(Camera); DefaultFont = Content.Load <SpriteFont>("Font"); RenderTargetMap = new RenderTarget2D(GraphicsDevice, 800, 480, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents); NonEuclideanRenders = new RenderTarget2D[10]; for (int i = 0; i < 10; i++) { NonEuclideanRenders[i] = new RenderTarget2D(GraphicsDevice, 800, 480, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents); } StairsCol2.Load(Content); illusion2plane = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColor), 6, BufferUsage.None); illusion2plane.SetData(new VertexPositionColor[] { new VertexPositionColor(new Vector3(-8.60f, 1.4f, -13.46f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 1.4f, -15.73f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 0f, -13.46f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 1.4f, -15.73f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 0f, -15.73f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 0f, -13.46f), Color.Red), }); illusion3plane = new VertexBuffer(GraphicsDevice, typeof(VertexPositionColor), 6, BufferUsage.None); illusion3plane.SetData(new VertexPositionColor[] { new VertexPositionColor(new Vector3(-8.60f, 1.4f, -18.73f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 1.4f, -21.00f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 0f, -18.73f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 1.4f, -21.00f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 0f, -21.00f), Color.Red), new VertexPositionColor(new Vector3(-8.60f, 0f, -18.73f), Color.Red), }); RoomIllusion1.Load(Content); SetDefaultSkinmeshLightning(RoomIllusion1.Model); NonEuclideanRenderFunctions.LoadSepShader(Content); pblack = new Texture2D(GraphicsDevice, 1, 1); pblack.SetData(new Color[] { Color.Black }); }