Newbie's question

MadMax

07-06-2009 16:57:51

Hello everyone,

first of all, many thanks to the developers of ogre and mogre for this great work.

I'm new to the topic and have a very basic question concerning textures. I would like to load a *.png image and apply it as texture to a sphere entity. It was easy to create the sphere but now I can't figure out how to load the png and apply it.

Any help (or even vb.net code :D ) would be greatly appreciated!

Max.

smiley80

07-06-2009 20:47:21

Create a text file with the following content:

material MySphereMaterial
{
technique
{
pass
{
texture_unit
{
texture [Filename].png
}
}
}
}

(replace [Filename] with the actual filename)
name it e.g. "MySphere.material",
and put it in one of the folders defined in your resources.cfg.

and then:
mySphereEntity.SetMaterialName("MySphereMaterial");

MadMax

08-06-2009 07:46:09

Thank you very much! Works great.

Yet another beginner's question:
For some reason I can't exactly track back, Mogre now is very slow, less than 1 fps. Additionally, the render engine selection screen at startup does no longer appear. As I didn't change anything in the code, the reason for that obviously is some configuration issue. I updated DirectX, could this be the reason? I already uninstalled both Mogre and DirectX an re-installed them, but the problem is still there.

Any ideas?

smiley80

08-06-2009 13:33:58

I don't have any issues running Mogre with the latest DirectX 9 version (March 09).

Mogre now is very slow, less than 1 fps.
Either you (accidentally) create a complex scene at startup or you do some heavy stuff in your main loop (which is e.g. the FrameStarted event handler).
Try to debug your program, maybe you find the cause.

the render engine selection screen at startup does no longer appear
I'm guessing that there's a root.RestoreConfig() somewhere, which loads the old ogre.cfg and prevents root.ShowConfigDialog() from being called.

mcaden

12-06-2009 00:24:20

Also make sure you're not running in debug. The renderer is extremely slow in debug.