Bogy
Community Member

Posts: 94
|
 |
« Reply #3 on: October 04, 2009, 10:35:52 AM » |
|
how do you use that CustomMinimesh.fx shader in your program?
i have something like: Shader2 = Scene.CreateShader("windyGrass"); Shader2.CreateFromEffectFile("Media\\Shaders\\CustomMinimesh.fx");
grassMesh = Scene.CreateBillboard(Globals.GetTex(billboardname.ToString()), 0, 0, 0, 1f, 1f, "thicky", false); grassMesh.SetMaterial(idNormal, -1); grassMesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_NORMAL, 1, 0);
Instancer = Scene.CreateMiniMesh(number, "thickGrass"); Instancer.CreateFromMesh(grassMesh, false); Instancer.SetAlphaTest(true, 128, true); Instancer.SetColorMode(true); Instancer.SetFadeOptions(true, 1500, 500); Instancer.SetMaterial(idNormal); Instancer.SetShader(Shader2); Random rand = new Random(); for (int i = 0; i < number; i++) { int x = rand.Next((int)minPosX, (int)maxPosX); int z = rand.Next((int)minPosZ, (int)maxPosZ); float y = Land.GetHeight(x, z);
Instancer.EnableFrustumCulling(true, false, true); Instancer.SetScale(scale, scale, scale, i); Instancer.SetPosition(x, y, z, i); Instancer.EnableMiniMesh(index, true); Instancer.SetColor(new TV_COLOR(1, 1, 1, 0.9f).GetIntColor(), i); }
the result is that nothing changes in the minimeshes. they are in the same place, staying still, not moving in the wind or something. how can i make them move in the wind based on this CustomMinimesh.fx shader?
|