public override void Init() { depthFBO = new FBO(0, 0, 1, true); ShadowMapping.Create(depthFBO, "lightmask.png"); font = BitmapFont.Load("fonts/comic12.png"); skybox = Sky.Load("sky/sky_", "jpg"); world.Add(skybox); GLSLShader.SetShader("shadowmapping.shader", "SHADOWS"); DotScene ds = DotScene.Load("scene1/scene1.scene", scene); world.Add(scene); actors[0] = AnimatedModel.Load("ugly/ukko.mesh"); actors[0].LoadMD5Animation("act1", "ugly/ukko_action1.anim"); actors[0].LoadMD5Animation("act2", "ugly/ukko_action2.anim"); actors[0].LoadMD5Animation("act3", "ugly/ukko_action3.anim"); actors[0].LoadMD5Animation("walk", "ugly/ukko_walk.anim"); actors[0].SetAnimation("act2"); // idle anim actors[0].Scale = new Vector3(5, 5, 5); world.Add(actors[0]); lightImg = Billboard.Load("lightimg.png"); Camera.Set3D(); base.Init(); }
public override void Init() { colorFBO = new FBO(0, 0, 2, true); // 2 colorbufferia depthFBO = new FBO(0, 0, 0, true); blurH = PostEffect.Load("blur.shader", "HORIZ"); blurH.SetParameter("size", 1f / (float)colorFBO.Width); blurV = PostEffect.Load("blur.shader", "VERT"); blurV.SetParameter("size", 1f / (float)colorFBO.Width); bloom = PostEffect.Load("bloom.shader", ""); bloom.SetParameter("size", 0.001f); Particles.EnableSoftParticles(); ShadowMapping.Create(depthFBO, "lightmask.png"); font = BitmapFont.Load("fonts/comic12.png"); skybox = Sky.Load("sky/sky2_", "jpg"); world.Add(skybox); lightImg = Billboard.Load("lightimg.png"); GLSLShader.SetShader("shadowmapping.shader", "SHADOWS"); DotScene ds = DotScene.Load("scene1/scene1.scene", scene); world.Add(scene); actors[0] = AnimatedModel.Load("ugly/ukko.mesh"); actors[0].LoadMD5Animation("act1", "ugly/ukko_action1.anim"); actors[0].LoadMD5Animation("act2", "ugly/ukko_action2.anim"); actors[0].LoadMD5Animation("act3", "ugly/ukko_action3.anim"); actors[0].LoadMD5Animation("walk", "ugly/ukko_walk.anim"); actors[0].SetAnimation("act2"); // idle anim actors[0].Position.Y = -0.5f; actors[0].Scale = new Vector3(5, 5, 5); world.Add(actors[0]); explosion = Particles.Load("explosion.particles.xml", new ParticleCallback(RenderParticleCallback)); smoke = Particles.Load("smoke.particles.xml", null); actors[0].Add(smoke); Camera.Set3D(); base.Init(); }
/// <summary> /// lataa skybox (ei cubemap). skyName on nimen alkuosa eli esim plainsky_ jos tiedostot on plainsky_front.jpg, plainsky_back.jpg jne /// ext on tiedoston pääte eli esim jpg, dds /// </summary> public static Sky Load(string skyName, string ext) { Sky sky = new Sky(); string[] sideStr = { "top", "bottom", "left", "right", "front", "back" }; Node skyNode = new Node(); DotScene ds = DotScene.Load("sky/sky.scene", skyNode); int side = 0; TextureLoaderParameters.WrapModeS = TextureWrapMode.ClampToEdge; TextureLoaderParameters.WrapModeT = TextureWrapMode.ClampToEdge; TextureLoaderParameters.FlipImages = false; skyNode.GetList(true); for (int q = 0; q < ObjList.Count; q++) { OgreMesh m = ObjList[q] as OgreMesh; if (m != null) { sky.skyboxSides[side] = m; m.Boundings = null; m.CastShadow = false; string fileName = skyName + sideStr[side] + "." + ext; m.MaterialName = fileName; m.Material = Material.GetMaterial(fileName + "_material"); m.Material.Textures[Settings.COLOR_TEXUNIT].Tex = Texture.Load(m.MaterialName); side++; } } TextureLoaderParameters.FlipImages = true; TextureLoaderParameters.WrapModeS = TextureWrapMode.Repeat; TextureLoaderParameters.WrapModeT = TextureWrapMode.Repeat; return(sky); }
public override void Init() { depthFBO = new FBO(0, 0, 1, true); ShadowMapping.Create(depthFBO, "lightmask.png"); Fog.CreateFog(0.005f, Fog.Color); GLSLShader.SetShader("default.shader", "FOG"); skybox = Sky.Load("sky/sky2_", "jpg"); world.Add(skybox); GLSLShader.SetShader("default.shader", "LIGHTING:PERPIXEL:FOG"); Model scene = new Model(); DotScene ds = DotScene.Load("scene1/scene1.scene", scene); world.Add(scene); camPath = Path.GetPath("Path_camera"); camPath.Attach(camera, true, true); font = BitmapFont.Load("fonts/comic12.png"); Camera.Set3D(); base.Init(); }
public static DotScene Load(string fileName, Node root) { DotScene ds = new DotScene(fileName, root); return(ds); }
public static DotScene Load(string fileName, Node root) { DotScene ds = new DotScene(fileName, root); return ds; }