terrain
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
terrain
Myladies and mylords,
Sire Niko put a first very simple terrain code to the download area of irrlicht.
I ask once again for help to tune the code to a get a really nice terrain renderer for all of us irrlicht-fans together (Or someone opens a better code, so we can throw this startcode into the trashcan or /dev/null ...)
Niko suggests that we should open a CVS-Modul in irrlicht.sf.net or a project at sourceforge. The code should be under the irrlicht-licence.
If you help, the help will be described with your name in the header, so everyone will see in future, that it was your help.
Any comment ?
Sire Niko put a first very simple terrain code to the download area of irrlicht.
I ask once again for help to tune the code to a get a really nice terrain renderer for all of us irrlicht-fans together (Or someone opens a better code, so we can throw this startcode into the trashcan or /dev/null ...)
Niko suggests that we should open a CVS-Modul in irrlicht.sf.net or a project at sourceforge. The code should be under the irrlicht-licence.
If you help, the help will be described with your name in the header, so everyone will see in future, that it was your help.
Any comment ?
Last edited by knightoflight on Mon Sep 08, 2003 2:43 pm, edited 1 time in total.
It crashes for me. I'm using Irrlicht 0.4 under Windows 2000 and VS.NET. Tried both drivers. If I remove the terrain lines, it works perfectly(but no terrain is showed XD).
Looking at the terrain code, it's quite simple, but well, cleanly coded. I think it would be better to return an OctreeSceneNode instead of an animatedmesh, so that only visible regions of the terrain are drawn.
Looking at the terrain code, it's quite simple, but well, cleanly coded. I think it would be better to return an OctreeSceneNode instead of an animatedmesh, so that only visible regions of the terrain are drawn.
-
- Posts: 81
- Joined: Fri Aug 22, 2003 12:06 pm
- Location: Germany
- Contact:
Just gave it a try, but I did not see anything more than Nikos Skybox and Water. The debug output tells me:
Cheers.Direct3D8: (ERROR) :*** Exception in d:\builds\nt32_chk\multimedia\directx\dxg\d3d8\fe\d3dbase.cpp Line: 3447
Direct3D8: (ERROR) :Primitive count or vertex count is too big. Check device caps.
First-chance exception at 0x77e4d756 in terrain.exe: Microsoft C++ exception: long @ 0x0011f860.
Direct3D8: (ERROR) :DrawIndexedPrimitiveUP failed.
matthias gall, lead programmer at sechsta sinn - email matthias@sechsta-sinn.de
-
- Posts: 64
- Joined: Mon Sep 08, 2003 8:21 am
- Location: Paris, France
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
Hi,
to tune the code to be better, maybe we need:
- single textures for single tiles ?
- detail textures for the near ?
- noise textures or other things for deleting the
seams ?
- reflecting water ?
- error handling in the class ?
- change to octtree, like Niko wrote ?
- ...
If you have the idea how one of this or other things could be lead to a better looking and performant terrain, please write some lines of code.
For example the change to use octtree - who answers the following question:
In the 2.quake map-example is written for better performance easy to change to octtree in this way:
[code]nodeterrain = smgr->addOctTreeSceneNode(meshterrain->getMesh(0));
[/code]
But it doesnt work, are the vertices in the quake map in a special format ? But i read the quake map format and saw nothing with octtree???
10.09.2003: ok now i saw that it works, i only have to wait cause 130000 polys are much, and to reduce the FarValue of the camera.
to tune the code to be better, maybe we need:
- single textures for single tiles ?
- detail textures for the near ?
- noise textures or other things for deleting the
seams ?
- reflecting water ?
- error handling in the class ?
- change to octtree, like Niko wrote ?
- ...
If you have the idea how one of this or other things could be lead to a better looking and performant terrain, please write some lines of code.
For example the change to use octtree - who answers the following question:
In the 2.quake map-example is written for better performance easy to change to octtree in this way:
[code]nodeterrain = smgr->addOctTreeSceneNode(meshterrain->getMesh(0));
[/code]
But it doesnt work, are the vertices in the quake map in a special format ? But i read the quake map format and saw nothing with octtree???
10.09.2003: ok now i saw that it works, i only have to wait cause 130000 polys are much, and to reduce the FarValue of the camera.
Last edited by knightoflight on Wed Sep 10, 2003 1:48 pm, edited 1 time in total.
-
- Posts: 64
- Joined: Mon Sep 08, 2003 8:21 am
- Location: Paris, France
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
im not a really skilled programmer, too,
like i wrote, renderterrain is a hack from Nikos CGeometrycreator, i try:
- in the first for-loops it creates the vertices (three vertex-coordinates and the y comes from the heightmap).
- in the second for-loops it creates two indices for the faces
- in the third for-loops it calculates the normals
like i wrote, renderterrain is a hack from Nikos CGeometrycreator, i try:
- in the first for-loops it creates the vertices (three vertex-coordinates and the y comes from the heightmap).
- in the second for-loops it creates two indices for the faces
- in the third for-loops it calculates the normals
Last edited by knightoflight on Tue Sep 09, 2003 8:06 pm, edited 1 time in total.
I started playing around with it and swapped a good portion out with ROAM 2.0 algorithms that I found in "Focus on 3D Terrain Programming", but I feel like I'm duplicating the effort in some parts.
If the terrain mesh is cast as an OctTree, then does the irrlicht engine handle culling for me automagically or should I still cull for myself?
If the terrain mesh is cast as an OctTree, then does the irrlicht engine handle culling for me automagically or should I still cull for myself?
Crud, how do I do this again?
fstream.h?
hey there,
"terrain.h" used a file called "fstream.h" which is under the GNU GPL. that would mean all programs using the terrain engine must be GPLed? am i right?
"terrain.h" used a file called "fstream.h" which is under the GNU GPL. that would mean all programs using the terrain engine must be GPLed? am i right?
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
-
- Posts: 14
- Joined: Tue Sep 09, 2003 4:48 pm
- Location: USA - All your base are belong to us
from fstream.h that comes with Dev-Cpp:
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
[etc]
hm.
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
[etc]
hm.
If a packet hits a pocket on a socket on a port,
And the buffer's interupted and the interupt's not caught,
Then the socket packet pocket has an error to report.....
And the buffer's interupted and the interupt's not caught,
Then the socket packet pocket has an error to report.....
-
- Posts: 108
- Joined: Fri Aug 22, 2003 1:04 pm
- Location: Kerkrade, Netherlands
- Contact:
-
- Posts: 199
- Joined: Sun Aug 24, 2003 5:47 pm
- Location: Germany
- to fstream.h and sire cyber_sneak:
my fstream.h says:
...
/***
*fstream.h - definitions/declarations for filebuf and fstream classes
*
* Copyright (c) 1991-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file defines the classes, values, macros, and functions
* used by the filebuf and fstream classes.
* [AT&T C++]
*
* [Public]
*
****/
...
but again, the code should be only a startcode and i wrote, please tell if you have ideas to get i better, so sire cyber_sneak, what c++ fileaccess-code should we use instead, please write.
- and to the question for collision-detection:
if you want to use the irrlicht-engine, we first should use octtree, then the irrlicht-collision-detection should be easier - but an other way is to use the heightmap. For example your player is at position x,z and falls from above, then you can easy look in the heightmap, at which height y he should stop and hits the ground...
my fstream.h says:
...
/***
*fstream.h - definitions/declarations for filebuf and fstream classes
*
* Copyright (c) 1991-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file defines the classes, values, macros, and functions
* used by the filebuf and fstream classes.
* [AT&T C++]
*
* [Public]
*
****/
...
but again, the code should be only a startcode and i wrote, please tell if you have ideas to get i better, so sire cyber_sneak, what c++ fileaccess-code should we use instead, please write.
- and to the question for collision-detection:
if you want to use the irrlicht-engine, we first should use octtree, then the irrlicht-collision-detection should be easier - but an other way is to use the heightmap. For example your player is at position x,z and falls from above, then you can easy look in the heightmap, at which height y he should stop and hits the ground...
Last edited by knightoflight on Wed Sep 10, 2003 1:50 pm, edited 1 time in total.
-
- Posts: 14
- Joined: Tue Sep 09, 2003 4:48 pm
- Location: USA - All your base are belong to us
stupid me look what comes just after the first part:
// ......Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.......
i should'a read the rest b4 posting. oh well.
// ......Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.......
i should'a read the rest b4 posting. oh well.
If a packet hits a pocket on a socket on a port,
And the buffer's interupted and the interupt's not caught,
Then the socket packet pocket has an error to report.....
And the buffer's interupted and the interupt's not caught,
Then the socket packet pocket has an error to report.....