Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 13:48

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 31.07.2008, 14:12 
Offline

Joined: 29.07.2008, 19:49
Posts: 11
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;
}


Top
 Profile  
Reply with quote  
PostPosted: 31.07.2008, 14:30 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
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.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 31.07.2008, 14:57 
Offline

Joined: 29.07.2008, 19:49
Posts: 11
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


Top
 Profile  
Reply with quote  
PostPosted: 31.07.2008, 15:15 
Offline

Joined: 29.07.2008, 19:49
Posts: 11
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group