Horde3D

Next-Generation Graphics Engine
It is currently 15.05.2024, 23:05

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Terrain Shading?
PostPosted: 15.01.2009, 00:48 
Offline

Joined: 01.01.2009, 21:09
Posts: 54
I just found out about the terrain shader. the "Shading Technique - Terrain Shading" on the wiki looks great but I dont really see how to implement it? I was able to compile the sample terrain but I see nothing. Do I need to recompile the engine with the extension in order to use it in the engine? It compiled with no erros and I saw the horde logo..

Also Is this extension used in the editor some how. Can I use the "add terrain" and if so how is a terrain designed? I see the plugin folder has a TerrainToolPlugIn.dll files in it but I dont see that in the editor.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shading?
PostPosted: 15.01.2009, 08:23 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
The editor brings a Horde3D DLL that has the terrain extension already build in, so you shouldn't need to recompile it. Before going into further details, try to check out the DominoSzene SVN folder in the Community SVN. It contains a scene file you can open directly in the editor. If that won't work we have to investigate the problem further, if it works, we can start going into details.

Keep also in mind that if you can't see anything, it may be helpful to take a look in the log files.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shading?
PostPosted: 15.01.2009, 17:25 
Offline

Joined: 01.01.2009, 21:09
Posts: 54
Volker, thx for he help.

The svn file ran fine. well I did get a sky box, domino's and a black and white terrain, if that is right.

When you said "The editor brings a Horde3D DLL that has the terrain extension already build in" Do you mean "add terrain" ? I would have though the extension or plug-ins would be in another menu. I tried to use that but it wanted to load a terrain and I dont know how to make one.

I see an error in the log.
Code:
0.000    Initializing OpenGL renderer using OGL '2.1.2' by 'NVIDIA Corporation' on 'GeForce 8800 GTS/PCI/SSE2/3DNOW!'
0.437    Adding Pipeline resource 'forward.pipeline.xml'
0.437    Adding Material resource 'font.material.xml'
0.437    Adding Material resource 'logo.material.xml'
0.437    Adding SceneGraph resource 'terrain.scene.xml'
0.453    Loading resource 'forward.pipeline.xml'
0.453    Adding Material resource 'globalSettings.material.xml'
0.453    Loading resource 'font.material.xml'
0.453    Adding Shader resource 'overlay.shader.xml'
0.453    Adding Texture2D resource 'font.tga'
0.453    Loading resource 'logo.material.xml'
0.453    Adding Texture2D resource 'logo.tga'
0.453    Loading resource 'terrain.scene.xml'
0.453    Resource 'terrain.scene.xml' of type 1: No data loaded (file not found?)
0.453    Loading resource 'globalSettings.material.xml'
0.453    Adding TextureCube resource 'ambientMap.png'
0.469    Loading resource 'overlay.shader.xml'
0.469    Shader resource 'overlay.shader.xml': Compiling shader context 'OVERLAY'
0.719    Loading resource 'font.tga'
0.781    Loading resource 'logo.tga'
0.797    Loading resource 'ambientMap.png'
0.797    Adding Camera node 'Camera'
0.797    Unloaded SceneGraph resource specified for addNodes (handle: 4)
0.797    Invalid Material resource handle 0 in setMaterialUniform

going to look at the file and find what is missing.

Ok in the file I have:
<Terrain name="Terrain" sx="1024.0" sy="300.0" sz="1024.0"
heightmap="terrain/heightmap.tga"
material="terrain/terrain.material.xml" />

Both files exist but heightmap is in the texture folder under terrain and I dont see how it knows to look for it there. Investigating....

On a limb here but the ResourceTypes does not include heightmap yet the exml calls for it?


Last edited by ulao on 15.01.2009, 17:41, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shading?
PostPosted: 15.01.2009, 17:39 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
The terrain rendering is a separate extension library that can be statically linked into the Horde3D.dll. By default this is not the case when you download Horde3D from SourceForge. In the editor this static library is linked in, so you are able to have terrain nodes in your scene graph. The editor tries to detect if the Horde3D DLL that is used by the editor supports the terrain extension and offers the Add Terrain option in the menus if possible.

The terrain is created using a heightmap (search the forums, I think there were some explanations somewhere already ) and a terrain shader.

Concerning the error log, I'm currently not sure why this happens. Can you check the scene graph in the editor which of the nodes receives the handle 4?

Edit:
Quote:
heightmap="terrain/heightmap.tga"
material="terrain/terrain.material.xml" />
Both files exist but heightmap is in the texture folder under terrain and I dont see how it knows to look for it there

The heightmap is a texture and such is searched in the TextureResource directory. Since it is referenced as "terrain/heightmap.tga" it should be found in such a subfolder in the textures directory.


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shading?
PostPosted: 15.01.2009, 17:59 
Offline

Joined: 01.01.2009, 21:09
Posts: 54
Quote:
Concerning the error log, I'm currently not sure why this happens. Can you check the scene graph in the editor which of the nodes receives the handle 4?
A bit confused if I dont have a scene file how can I load it. To entertain the idea I created one and was planning on loading the terrain data but the light already gets resource 4 and I need a light.

When adding the terrain in the editor I get the same error but I cant copy all of it as there are no text functions ;(

Something like

resource 'utilityLib/ vertcommon
resource 'utilityLib/ fragdeferredwrite
resource 'utilityLib/ fraglighting

all with type 5 no data loaded (file not found?)


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shading?
PostPosted: 15.01.2009, 22:05 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I'm also a bit confused, about what the log refers to. Is it from the terrain example from the download page or from one of the SVN branches? Or is it from the GameEngine Domino scene?


Top
 Profile  
Reply with quote  
 Post subject: Re: Terrain Shading?
PostPosted: 15.01.2009, 22:15 
Offline

Joined: 01.01.2009, 21:09
Posts: 54
Per the errors from the editor, it was missing .glsl files. I just dumped some in there and it showed up as a very messy ( noise) like purple mesh. Looks like a terrain that was interpreted wrong.

Quote:
I'm also a bit confused, about what the log refers to. Is it from the terrain example from the download page or from one of the SVN branches? Or is it from the GameEngine Domino scene?


Well the log I posted was from the VS2005 (html log) build attempt from that download you linked me to.

The log from the editor I referred to above was from a scn file I put together from the same download. So I may have cause that error by not knowing about the .glsl files.

Downloading the extension should work out of the box, but for some reason it show nothing. All I have to go on is that HTML log output above.


A side note that may be the issue.

from the read me..
Quote:
In Visual Studio, add the extension and sample projects to the Horde3D solution. Then add the extension
project to the project dependencies of the Horde3D Engine and the Horde3D Engine to the dependencies of
the Terrain Sample. After that, include 'Terrain/extension.h' in 'egExtensions.cpp' of the engine and add
'#pragma comment( lib, "Extension_Terrain.lib" )' to link against the terrain extension (under Windows).
Finally, add the following line to ExtensionManager::installExtensions to register the extension:

installExtension( Horde3DTerrain::getExtensionName, Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension );

The extension is then part of the Horde3D DLL and can be used with the Horde3DTerrain.h header file.

The extension defines the uniform *terBlockParams* and the attribute *terHeight* that can be used
in a shader to render the terrain. To see how this is working in detail, have a look at the included
sample shader.


All I did was extract the zip file as instructed. Then I just compiled and ran.


but for example..

Quote:
add the extension and sample projects to the Horde3D solution.

What Horde3D solution, the source code? My project? The samples? Horde3D solution as in the folder? I know what that "sample projects" are, but what is the "extension"?

Quote:
Then add the extension
project to the project dependencies of the Horde3D Engine and the Horde3D Engine to the dependencies of
the Terrain Sample.
HUH?? LOL that is like crazy talk. A project is a VS project, how do you add that to something? Then it says to add it to the Horde3D Engine.. Again what Horde3D Engine? The engine is nothing more then an SDK right? Then add this engine back to the terrain sample? Man I feel so dizzy..

I dont know what all this is to mean but if there is more to the Horde3D_ExtTerrain please direct me to a place that will help. I dont claim to be an expert with VS, but I have used it for 5 years. That above line to me is gibberish.

I think following this explains a lot. http://www.horde3d.org/forums/viewtopic.php?f=8&t=237&p=1232&hilit=terrain+extension#p1232

I'm not sure as I was not around then but I'm guessing this talk above was in reference to how it used to be done. And now it works alone, which would clear up the confusion. If so I would remove all of that info if it is truly not relevant. If so I would guess I could just ad the bindings to my header folder? Or include the bindings in my header string.

I completely removed it and downloaded a fresh copy and now I get this log
Quote:
0.000 Initializing OpenGL renderer using OGL '2.0.3' by 'NVIDIA Corporation' on 'GeForce 7300 SE/PCI/SSE2/3DNOW!'
0.000 Extension EXT_framebuffer_multisample and/or EXT_framebuffer_blit not supported
0.344 Adding Pipeline resource 'forward.pipeline.xml'
0.344 Adding Material resource 'font.material.xml'
0.344 Adding Material resource 'logo.material.xml'
0.344 Adding SceneGraph resource 'terrain.scene.xml'
0.344 Loading resource 'forward.pipeline.xml'
0.344 Adding Material resource 'globalSettings.material.xml'
0.344 Loading resource 'font.material.xml'
0.344 Adding Shader resource 'overlay.shader.xml'
0.344 Adding Texture2D resource 'font.tga'
0.344 Loading resource 'logo.material.xml'
0.344 Adding Texture2D resource 'logo.tga'
0.344 Loading resource 'terrain.scene.xml'
0.344 SceneGraph resource 'terrain.scene.xml': Unknown node type or missing attribute for 'Terrain'
0.344 Loading resource 'globalSettings.material.xml'
0.344 Adding TextureCube resource 'ambientMap.png'
0.344 Loading resource 'overlay.shader.xml'
0.344 Shader resource 'overlay.shader.xml': Compiling shader context 'OVERLAY'
0.454 Loading resource 'font.tga'
0.532 Loading resource 'logo.tga'
0.532 Loading resource 'ambientMap.png'
0.547 Adding Camera node 'Camera'
0.547 Adding nodes from SceneGraph resource 'terrain.scene.xml'
0.547 Invalid Material resource handle 0 in setMaterialUniform


My guess is that it does not know the attribute "heightmap" and if so I must be missing a step?

for the solution or further help see viewtopic.php?f=1&t=611


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 12 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:  
Powered by phpBB® Forum Software © phpBB Group