Jump to content

Recommended Posts

Posted (edited)

Ok, i have made a screenshot from it:

Posted Image

Greets!

Hi,

As a guess I'd say the reason your getting the wrong width/height is because Irrlicht engine is loading the image as a texture and auto making the texture to the power of 2.

Cheers

Edited by smashly
Posted

Hi, yes it does give real width and height if the texture is to the power of 2..

eg: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048...etc

If your video card supports non power of 2 textures you could try using _IrrSetTextureCreationFlag(0x00000040, $IRR_ON) before creating the texture (0x00000040 = ETCF_ALLOW_NON_POWER_2, may make no difference).

But by default Irrlicht engine will scale the texture to a power of 2 if it's not already.

If you would like to know if your video card supports non power of 2 textures then use _IrrQueryFeature()

(Have a look in the examples folder for 023_Example_Video_Features.au3 to see).

But the bottom line is what you think may be a bug of au3Irrlicht2 is actually part of Irrlicht core and Franks Wrapper.

Cheers

Posted (edited)

Your welcome,

In regards to the FontTool.exe..

When you save a font it will generate a xml file along with your font image..

Use the xml with _IrrGetFont()..

#include "au3Irrlicht2.au3"
_IrrStart()
Global $hFont = _IrrGetFont ( "./media/ComicSansMS16px.xml")

While _IrrRunning()
    _IrrBeginScene( 0,0,0 )
    _Irr2DFontDraw ($hFont, "Comic Sans MS, 16px, 512x512", 120, 80, 250, 96 )
    _IrrEndScene()
WEnd

_IrrStop()
Font and xml (generated with FontTool.exe) attached:

(you need the ComicSansMS16px.xml and ComicSansMS16px0.png to be in the same directory as each other of coarse)

XML file:

Font Image (PNG):

Cheers

Edited by smashly
Posted (edited)

...and i wonder about the generated .xml :graduated:

And i think the reason about 650MB Ram within only loaded 40 Textures is '...making the texture to the power of 2'; right?!? I have think about that i generated a Memory-Lag...

Thank´s for the replies!!

[Edit]

'...power of 2...' means also that the memory usage of the loaded Textures is 4xfilesize; right?!?

Edited by Techmix
Posted

Hi,

650mb for 40 textures @ 2048x1024 sounds a bit big, it should be about half that size around 320MB ~ 350MB.

Not sure maybe my maths is not correct (I'm hopeless at math ..lol)

2048 * 1024 * 40 = 83886080 pixels

;4 bytes to a 32 bit pixel (I think, not sure)

4 * 83886080 = 335544320 bytes

;1024 bytes makes a Kilobyte

;1024 Kilobytes makes a Megabyte

335544320 / 1024 / 1024 = 320MB

:graduated:

Posted

i have take a look and there are over 120 Pics that are Loaded in different ways in the Ram: Skybox, Textures and Billboards.

And my WindowsXP may have a memory usage about 127MB. Round-About it´s 687MB-127MB = 560MB. BUT when i take a Look at the Task-Manager my Programm-Process is only at the Loadingtime about 120-150MB and after that the Process shows only 35MB. But the final memory usage is about 687MB.

...at that XP computer i have only 512MB Ram, and then it swaps, and swaps, and have many lags; did i start it in this computer (with 1.5GB) with Win7 there are no swapping and no lags.

Posted (edited)

I'm thinking to start "irrKlang Wrapper" project but I dont know anything to wrapping with autoit :(

Hi,

Linus has started on it already. Shoukd be some basic sound functions included in next release (v2.05).

You can have a look in the help file from here

Edit: Not to put a downer on it, but irrKlang isn't that good the way it is now imho.

When/If Frank makes it so that Irrlicht Wrapper can handle the sounds.. eg: attach a sound event to a node etc, then it takes the load off of autoit's main loop.

As it is a user will need to detect when the sound needs to be played and call it in their loop.

If the the wrapper handled playing the sound on an event then it frees up the main loop of Autoit.

Autoit is not fast so having to check for an event and firing a sound every cycle of your main loop is just going to make things slower and more work.

For example I have a 1000 asteroids crashing randomly into a planet, so now in my main autoit loop I have to check if 1 of 1000 asteroids has hit the planet and then play a sound if they have...

There are work arounds so I'm not having to loop through 1000 asteroids, but it would make is so much easier if I just attch a sound event to an asteroid node and that event is fired by the engine upon collision.

But that's just me being negative, some sound is better than no sound over all :graduated:

Cheers

Edited by smashly
Posted (edited)

If you are interested in using the dev version see here - you'll need an subversion client for this, best I know is TortoiseSVN.

But be aware - dev version means it's a dev version. Definetly not recommended for usage without fun to figure out independently how uncomplete things work (and why (yet) not!!) :(

@smashly: great to see you doing support inside this thread; I am alive but VERY short on time :graduated:

Edited by linus
Posted

ok i got all the examples working running under 32 part from one example

004_Example_3DModel just crashes i get the stopped working error

Posted (edited)

thanks how do you add the textures to it to. cos i dont see anything

how do we find the pos to make _IrrSetNodePosition and _IrrSetNodeRotation

Edited by hot202
Posted

_IrrSetNodeMaterialTexture($TerrainNode, _IrrGetTexture( Path to texture ), 0)

The final number is a texture layer, in the examples I only ever see them use 2 textures on the same mesh 0 and 1 so I don't know if it will support more.

$pos = _IrrGetNodeAbsolutePosition($TerrainNode)

That will give an array of coordinates of the current position ($pos[0], $pos[1], $pos[2])

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...