Page 12 of 16

Posted: Tue Sep 04, 2007 10:30 pm
by krensauce
Rook Zimbabwe wrote:[ESC] worked in the earlier version of PB, I haven't tried the demos with 4.02 yet as I am waiting for ogre improvements of trying to unravel the HGE Engine I need to use with it!
It's not PB version, it's the fact that the Irrlicht examples have no quit code, so you have to close them the "old-way".
Ogre examples simply detects the ESC key-press and quit the program in that case.

Posted: Wed Sep 05, 2007 1:11 am
by T-Light
This is weird, I'm still having problems with this old chestnut...

Triangles (missing polys) in renders.
They only happen with Irrlicht terrains and Irrlicht BSP's. They don't happen with any other kind of mesh and they only occur when running the dx9 driver. Everything's fine with opengl. I've tried the irrlicht wrapper for pb, the wrapper for bmax and now the latest Irrlicht for c++, all show the same problem. I haven't seen these errors with any other software other than Irrlicht.

I'll pop these up again here in case it rings any bells and I'll post them on the main Irrlicht forum.

ps, Thalius, thanks for the advice earlier in the year, I suppose I was hoping these things would clear themselves up but no luck :roll:

DX version 9.20.1057 (31st of July 2007) (installed)
Latest NVidia driver released for the laptop 97.55c (installed)

Vista Premium
2.0 Ghz Dual Core
2Gb ram
NVidia 7600 256MB

Image
Image

Posted: Wed Sep 05, 2007 2:07 am
by T-Light
There was another chap had posted the same problems on the main Irrlicht bug forums with Irrlicht vs Vista a few months ago so I've bumped the thread.

Hoping it gets some attention really, I'm guessing there's still not a huge amount of developers working on Vista at the mo, I just don't want to release something and find there's thousands of Vista users complaining to me with the same problems :shock: :x :D

Posted: Wed Sep 05, 2007 2:17 am
by T-Light
Me me me. Sorry, last post here for a little while.

I'm going to try building a landscape in Lightwave and see how that compares on speed and quality. If I get something nice I'll post back.

Posted: Wed Sep 05, 2007 6:11 am
by T-Light
Early days, haven't ran any speed comparisons between Irrlichts native terrain and this yet but it seems nippy enough. There isn't any detail mapping applied to the LW model, it's just the straight area lights + radiosity baked image (1024*1024).

Here's my initial test. - (Absolutely NO missing polygons :D )

Image

Posted: Wed Sep 05, 2007 6:28 am
by T-Light
Playing around in full screen and starting to like this. I'll have a play with more detailed textures later today, (If I can figure out how to get a detail map to work with a .x file :shock: )

Sorry for the image size but I'd rather show this 1:1 rather than scale it down to make it look better.

Image

Posted: Wed Sep 05, 2007 2:22 pm
by Thalius
Nice ! :D

the Detailmap is a second Texture you either can Tile or stretch etc over the colourmap. Detailmap uses the texture layer 1 of the material applied to the Terrain / Mesh ( See terrain Example ). Ofc dont forget to set the Material flag to Detail-Mapping. ;)

Thalius

Posted: Wed Sep 05, 2007 4:48 pm
by T-Light
Hello there Thalius :D

Yes, I'm still very very noob when it comes to Irrlicht :roll: (Trying to use it for real now rather than just my usual playing). When I tried writing the detail map code for it this morning I kept getting an 'invalid memory access' with this line of code...
IrrScaleTexture( *SceneNode, 1.0, 20.0 )
Coudn't post it as a bug then because I'm not even sure how Irrlicht knows which texture I want scaling in the scene node? Or does this command ONLY work on the second texture in the node? Either way, I'd pretty much coppied letter for letter from the Terrain example on how to apply it to another mesh. Might have got confused somewhere along the line. Here's the nub of the code...

Code: Select all

  ; load a mesh this acts as a blue print for the model
  *Mountain = IrrGetMesh( "media\mountain.x" )
  
  ; load texture resources for texturing the scene nodes
  *MeshTexture = IrrGetTexture( "media\mountex.jpg" )
  *MeshTexture2 = IrrGetTexture( "media\detail-grass.jpg" )
  
  ; mesh object supplied here
  *SceneNode = IrrAddMeshToScene( *Mountain )

    irrsetnodescale(*SceneNode,30,30,30)

  ; apply a material to the node to give its surface color
  IrrSetNodeMaterialTexture( *SceneNode, *MeshTexture, 0 )

    ; the second texture is tiled many times across the map this adds fine detail
  ; and structure to the first enlarged terain color
  IrrSetNodeMaterialTexture( *SceneNode, *MeshTexture2, 1 )
  
; we set the scale of the detail map so its repeated 20 times across the map in
  ; the x and y axis
  IrrScaleTexture( *SceneNode, 1.0, 20.0 ) 
And that's it, it crashes on the last line there. Am I missing something?

Posted: Thu Sep 06, 2007 12:19 am
by T-Light
Thalius, I can't find any way of making ScaleTexture work with a mesh. In the Irrlicht API it says that ScaleTexture is only part of the Terrain Scene node class? I've looked around for an alternative but can only find

Code: Select all

makePlanarTextureMapping()
Unfortunately, this only seems to work with single texture layers. Apparently detailmapping was added for meshes in IrrSpintz but hasn't been added to the Irrlicht code yet.

Actually, that last bit of info may be out of date now, it was from a thread on irrlicht.sourceforge back in January.

Suppose there is an old fashioned way of doing this by copying the model, moving it up a relative inch or so and applying a semi-transparent tiled texture for the detail map. Wouldn't fancy those poly counts though. :shock:

Posted: Thu Sep 06, 2007 4:21 pm
by T-Light
Me -
Yes, I'm still very very noob when it comes to Irrlicht :roll:
Just re-read that and it looks like sarcasm with the role eyes thing at the end. Very sorry, that wasn't the way I meant to come across at all.

I rewrote the landscape routines in C++ last night to compare speeds with this version of the wrapper in PB (very favourable I should say), but there was a downside. On the dx9 driver with Irrlicht 1.31 it smashed the x file to pieces. I've been through the file in a text editor to see if it has any problems (left overs from LW->X) and can't see anything at all. Weird.

Posted: Mon Sep 10, 2007 8:43 am
by citystate
Does anyone know how to create a Terrain from an image in memory (without needing disk access)?

Posted: Mon Sep 10, 2007 4:09 pm
by Thalius
Does anyone know how to create a Terrain from an image in memory (without needing disk access)?
Not yet possible as the terrain system requires a filename. However you could create a terrain mesh and store that in a datasection. The disadvantage would be to not have the LOD reduction on a static model so you would have to Octree it to achieve more performance ( might result in holes in the terrain tho depending on viewportsize etc. )

Textures however can be read from memory using:

Get texture from memory (image is loaded via PB Image functions):

Code: Select all

*mytexture = IrrPBImage2Texture(ImageNo.l, name.s, hasAlpha.l = #True)
Get mesh from memory:

Code: Select all

*mesh.l = IrrGetMeshFromMemory(?mymesh,?mymeshens-?mymesh,"MyMesh",#False)   

If *mesh = #Null       
   ... if Irrlicht could not load the Mesh..   
EndIf   
DataSection   
  mymesh: IncludeFile "MyOwnMesh.dmf"   
  mymeshend:   
EndDatasection

As another hint you can add all your media data including terrain in a ZIP/PAK archive - irrlicht can access theese like directories.


Thalius

Posted: Wed Sep 12, 2007 5:02 am
by citystate
is that a failing of the wrapper or Irrlicht itself?

(useful tips btw - thanks)

Posted: Wed Sep 12, 2007 5:27 pm
by Thalius
well its that way in the engine - however could be changed aswell once we have a stable - since its opensource ;)

Posted: Wed Sep 12, 2007 10:49 pm
by Thalius
Just to keep you informed:

We are working on bugfixes and some nice Game Examples which should help you get started.

I put the shader playing aside for the moment as theres some other examples to fix first and ofc the bughunt!

Please PM me if you have additional Info for the Manual also or notice errors in it - so i can make up a fix.

Thalius