public override void Init() { model = ((Node)AssetManager.LoadModel(AssetManager.GetAppPath() + "\\models\\dome.obj")).GetChildGeom(0); model.Material.SetValue(Material.MATERIAL_FACETOCULL, 1); model.Material.SetValue(Material.MATERIAL_DEPTHMASK, false); model.Material.SetValue(Material.MATERIAL_DEPTHTEST, false); model.Material.Bucket = RenderManager.Bucket.Sky; model.SetShader(typeof(SkyShader)); model.SetLocalScale(new Math.Vector3f(100f)); rootNode.AddChild(model); }
public override GameObject Clone() { Geometry res = new Geometry(); res.SetLocalTranslation(this.GetLocalTranslation()); res.SetLocalScale(this.GetLocalScale()); res.SetLocalRotation(this.GetLocalRotation()); res.Mesh = this.mesh; res.shader = this.shader; res.depthShader = this.depthShader; res.normalsShader = this.normalsShader; res.ShaderProperties = this.ShaderProperties; return res; }
public override GameObject Clone() { Geometry res = new Geometry(); res.SetLocalTranslation(this.GetLocalTranslation()); res.SetLocalScale(this.GetLocalScale()); res.SetLocalRotation(this.GetLocalRotation()); res.Mesh = this.mesh; res.shader = this.shader; res.depthShader = this.depthShader; res.normalsShader = this.normalsShader; res.ShaderProperties = this.ShaderProperties; return(res); }
public override GameObject Clone() { Geometry res = new Geometry(); res.SetLocalTranslation(this.GetLocalTranslation()); res.SetLocalScale(this.GetLocalScale()); res.SetLocalRotation(this.GetLocalRotation()); res.Material = this.Material.Clone(); res.Mesh = this.mesh; res.shader = this.shader; res.depthShader = this.depthShader; res.normalsShader = this.normalsShader; res.ShaderProperties = this.ShaderProperties; for (int i = 0; i < controls.Count; i++) { res.AddController(controls[i]); } return res; }
public override GameObject Clone() { Geometry res = new Geometry(); res.SetLocalTranslation(this.GetLocalTranslation()); res.SetLocalScale(this.GetLocalScale()); res.SetLocalRotation(this.GetLocalRotation()); res.Material = this.Material.Clone(); res.Mesh = this.mesh; res.shader = this.shader; res.depthShader = this.depthShader; res.normalsShader = this.normalsShader; res.ShaderProperties = this.ShaderProperties; for (int i = 0; i < controls.Count; i++) { res.AddController(controls[i]); } return res; }
static TreePopulator() { /* tree = (Node)AssetManager.LoadModel(AssetManager.GetAppPath() + "\\models\\tree\\pine\\LoblollyPine.obj"); tree.GetChildGeom(1).Material.SetValue("tree_height", tree.GetLocalBoundingBox().Max.y); tree.GetChildGeom(1).SetShader(typeof(BarkShader)); tree.GetChildGeom(1).DepthShader = ShaderManager.GetShader(typeof(BarkShader), new ShaderProperties() .SetProperty("DEPTH", true) .SetProperty(Material.TEXTURE_DIFFUSE, true)); tree.GetChildGeom(2).Material.SetValue("tree_height", tree.GetLocalBoundingBox().Max.y); tree.GetChildGeom(2).Material.SetValue(Material.MATERIAL_BLENDMODE, 1); tree.GetChildGeom(2).Material.SetValue(Material.MATERIAL_CULLENABLED, false); tree.GetChildGeom(2).Material.SetValue(Material.MATERIAL_ALPHADISCARD, 0.7f); tree.GetChildGeom(2).Material.Bucket = Rendering.RenderManager.Bucket.Transparent; tree.GetChildGeom(2).SetShader(typeof(LeafShader)); tree.GetChildGeom(2).DepthShader = ShaderManager.GetShader(typeof(LeafShader), new ShaderProperties() .SetProperty("DEPTH", true) .SetProperty(Material.TEXTURE_DIFFUSE, true));*/ tree = new Node(); Geometry g = new Geometry(MeshFactory.CreateQuad()); g.SetLocalScale(new Vector3f(15)); g.SetLocalTranslation(new Vector3f(0, 10, 0)); g.Material.SetValue(Material.MATERIAL_CASTSHADOWS, 0); g.Material.SetValue(Material.MATERIAL_BLENDMODE, 1); g.Material.SetValue(Material.TEXTURE_DIFFUSE, AssetManager.LoadTexture(AssetManager.GetAppPath() + "\\models\\tree\\pine\\billboard.png")); g.Material.SetValue(Material.SHININESS, 0.0f); g.Material.SetValue(Material.MATERIAL_ALPHADISCARD, 0.5f); g.Material.Bucket = RenderManager.Bucket.Transparent; g.SetShader(typeof(GrassShader)); g.Material.SetValue("fade_start", 250.0f); g.Material.SetValue("fade_end", 260.0f); tree.AddChild(g); }