Horde3D
http://horde3d.org/forums/

.net wrapper 0.13 problem
http://horde3d.org/forums/viewtopic.php?f=2&t=451
Page 1 of 1

Author:  onurakkaya [ 31.07.2008, 14:12 ]
Post subject:  .net wrapper 0.13 problem

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;
}

Author:  swiftcoder [ 31.07.2008, 14:30 ]
Post subject:  Re: .net wrapper 0.13 problem

Have you checked the error log, to see if any errors occurred? More importantly, have you created a camera? I don't see one in your code there, but maybe you defined one in your scene file.

Author:  onurakkaya [ 31.07.2008, 14:57 ]
Post subject:  Re: .net wrapper 0.13 problem

i created camera like this

_cam = Horde3D.addCameraNode(Horde3D.RootNode, "Camera");

in debug view i can see the sun but still i cant see terrain

Author:  onurakkaya [ 31.07.2008, 15:15 ]
Post subject:  Re: .net wrapper 0.13 problem

my logs :

0.000 Loading pipeline 'forward.pipeline.xml'
0.015 Adding resource materials/font.material.xml
0.015 Adding resource materials/logo.material.xml
0.015 Adding resource models/terrain.scene.xml
0.031 Loading resource materials/font.material.xml
0.031 Adding resource shaders/overlay.shader.xml
0.031 Adding resource textures/font.tga
0.031 Loading resource materials/logo.material.xml
0.031 Adding resource textures/logo.tga
0.031 Loading resource models/terrain.scene.xml
0.031 Loading resource shaders/overlay.shader.xml
0.031 Compiling shader context shaders/overlay.shader.xml--->OVERLAY
0.125 Loading resource textures/font.tga
0.125 Loading resource textures/logo.tga
0.125 Adding node from resource models/terrain.scene.xml
0.125 Adding node Camera
0.125 Adding node Light1

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/