hi i tried to implement terrain sample on .net wrapper 0.13 but only logo displayed on the screen help plz
here my init func
public bool init() { // Initialize engine if (!Horde3D.init()) { Horde3DUtils.dumpMessages(); return false; }
// Set paths for resources Horde3D.setResourcePath(Horde3D.ResourceTypes.SceneGraph, "models"); Horde3D.setResourcePath(Horde3D.ResourceTypes.Geometry, "models"); Horde3D.setResourcePath(Horde3D.ResourceTypes.Animation, "models"); Horde3D.setResourcePath(Horde3D.ResourceTypes.Material, "materials"); Horde3D.setResourcePath(Horde3D.ResourceTypes.Code, "shaders"); Horde3D.setResourcePath(Horde3D.ResourceTypes.Shader, "shaders"); Horde3D.setResourcePath(Horde3D.ResourceTypes.Texture2D, "textures"); Horde3D.setResourcePath(Horde3D.ResourceTypes.TextureCube, "textures"); Horde3D.setResourcePath( Horde3D.ResourceTypes.Effect, "effects" );
// Load pipeline configuration if (!Horde3D.loadPipelineConfig("forward.pipeline.xml")) { Horde3DUtils.dumpMessages(); return false; }
// Set options Horde3D.setOption( Horde3D.EngineOptions.LoadTextures, 1 ); Horde3D.setOption( Horde3D.EngineOptions.TexCompression, 0 ); Horde3D.setOption( Horde3D.EngineOptions.FastAnimation, 0 ); Horde3D.setOption( Horde3D.EngineOptions.AnisotropyFactor, 8 ); Horde3D.setOption( Horde3D.EngineOptions.ShadowMapSize, 2048 );
// Add resources // Font _fontMatRes = Horde3D.addResource(Horde3D.ResourceTypes.Material, "font.material.xml", 0); // Logo _logoMatRes = Horde3D.addResource(Horde3D.ResourceTypes.Material, "logo.material.xml", 0); // Environment int envRes = Horde3D.addResource(Horde3D.ResourceTypes.SceneGraph, "terrain.scene.xml", 0);
// Particle system int particleSysRes = Horde3D.addResource(Horde3D.ResourceTypes.SceneGraph, "terrain.scene.xml", 0);
// Load resources Horde3DUtils.loadResourcesFromDisk( "content" );
// Add scene nodes // Add environment Horde3D.addNodes( Horde3D.RootNode, envRes );
// Attach particle system to hand joint int hand = Horde3D.getNodeChild(envRes, "Bip01_R_Hand", 0, true); _particleSys = Horde3D.addNodes(hand, particleSysRes); Horde3D.setNodeTransform(_particleSys, 0, 40, 0, 90, 0, 0, 1, 1, 1);
// Add light source int light = Horde3D.addLightNode(Horde3D.RootNode, "Light1", 0, "LIGHTING", "SHADOWMAP"); Horde3D.setNodeTransform(light, 512, 700, -256, -120, 0, 0, 1, 1, 1); Horde3D.setLightParam(light, Horde3D.LightNodeParams.Radius, 2000); Horde3D.setLightParam(light, Horde3D.LightNodeParams.FOV, 90); Horde3D.setLightParam(light, Horde3D.LightNodeParams.ShadowMapCount, 3); Horde3D.setLightParam(light, Horde3D.LightNodeParams.ShadowSplitLambda, 0.5f); Horde3D.setLightParam(light, Horde3D.LightNodeParams.ShadowMapBias, 0.005f); Horde3D.setLightParam(light, Horde3D.LightNodeParams.Col_R, 1.0f); Horde3D.setLightParam(light, Horde3D.LightNodeParams.Col_G, 0.9f); Horde3D.setLightParam(light, Horde3D.LightNodeParams.Col_B, 0.7f);
// Customize post processing effects int matRes = Horde3D.findResource(Horde3D.ResourceTypes.Material, "terrain/terrain.material.xml"); // hdrParams: exposure, brightpass threshold, brightpass offset Horde3D.setMaterialUniform(matRes, "sunDir", 1, -1, 0, 0);
_initialized = true;
return true; }
|