Page 1 of 1

Something like the Sun

Posted: Fri Dec 23, 2005 6:10 pm
by Mansur
Hello,

i tried to generate a sun with Ogre!
I used the particlesystem for my "first-light".

This is my particle script:

Code: Select all

Space/Sun
{
    material        Examples/Flare
    particle_width  20
    particle_height 20
    cull_each       false
    quota           100
    billboard_type  point
    
    // Area emitter
    emitter Ellipsoid
    {
        angle           30
        emission_rate   30
        time_to_live_min 2
        time_to_live_max 5
        direction       0 1 0
        velocity    	0.001
        colour 0.15 0.1 0.0
        width           5
        height          5
        depth           5
    }

    // Fader
    affector ColourFader
    {
        red -0.010
        green -0.025
        blue -0.025
    }
}
:!: For a better result you have to change the flare.png from the example textures! Around the flare it should be realy black, then you see no edges at the sun :!:

Perhaps someone can use it, or post something better :wink:

PS:
I know my english is bad...

Posted: Fri Dec 23, 2005 7:56 pm
by steven
Nice :)

There are so many message that it will quickly be lost if not on the wiki.

You could wiki it for example on :
http://www.ogre3d.org/wiki/index.php/Co ... 6_Textures

In fact a section of the wiki could be dedicated for such ressources : mesh, texture, etc.

PS : If you don't know it your wiki account is the same as the forum.

Screenshot

Posted: Sat Dec 24, 2005 11:47 am
by Mansur
Image

Posted: Sun Dec 25, 2005 12:43 am
by draxd80
Can you upload source of that nice looking SUN :) . I need something like that for little game i plan to make

Posted: Sun Dec 25, 2005 10:40 am
by nikki
Can you upload source of that nice looking SUN. I need something like that for little game i plan to make
He has already shown the script in the first post! :)

Posted: Mon Dec 26, 2005 5:12 am
by rookie1
Mansur, can you upload your flare.png as well? i had a few attempts, but couldn't get the result to look as nice as yours.

Posted: Mon Dec 26, 2005 8:08 am
by Mansur

Posted: Mon Dec 26, 2005 3:01 pm
by draxd80
Hello me again , Im lame ogre newbie , I would realy love when you would upload source of that nice looking sun you made so I could C how you made it :)

...btw I know my english sux ar*

Posted: Mon Dec 26, 2005 6:22 pm
by IFASS
draxd80 wrote:Hello me again , Im lame ogre newbie , I would realy love when you would upload source of that nice looking sun you made so I could C how you made it :)

...btw I know my english sux ar*
The source is in the startpost....

Posted: Mon Dec 26, 2005 6:23 pm
by Robomaniac
He already did, all you need is the .particle file he posted in the first post...

Posted: Fri Jan 06, 2006 1:53 am
by Rackle
The code in Samples/ParticleFX provides additional examples. Hopefully this can get you started:

Code: Select all

/* http://www.ogre3d.org/wiki/index.php/ParticleExampleSun
 * Requires:
 *   Media/Particle/Sun.particle
 */

#include "ExampleApplication.h"

class Application : public ExampleApplication
{
protected:
public:
    Application()
    {
    }

    ~Application() 
    {
    }
protected:
    void chooseSceneManager(void)
    {
        mSceneMgr = mRoot->getSceneManager(ST_EXTERIOR_CLOSE);
    }

    void createScene(void)
    {
        mSceneMgr->setSkyBox( true, "Examples/SpaceSkyBox" );
		ParticleSystem* sunParticle = ParticleSystemManager::getSingleton().createSystem("Sun", "Space/Sun");
		SceneNode* particleNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("Particle");
		particleNode->attachObject(sunParticle);
    }
};

#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
#define WIN32_LEAN_AND_MEAN 
#include "windows.h" 

INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) 
#else 
int main(int argc, char **argv) 
#endif 
{ 
    Application app; 
    try 
    { 
        app.go(); 
    } 
    catch( Exception& e ) 
    { 
#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
        MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL); 
#else 
        fprintf(stderr, "An exception has occured: %s\n",e.getFullDescription().c_str()); 
#endif 
    } 
    
    return 0; 
} 

Posted: Fri Jan 06, 2006 6:37 am
by crawmm
Just curious... how big could you make something like that? Outside of machine limitations of course. I don't recall seeing any limits in OGRE itself that would limit the size of something like that.

Posted: Fri Jan 13, 2006 7:19 pm
by ScurvyKnave
Big in terms of how many particles, or how large it would appear on screen? I'm pretty sure you can use as many particles as you like, although this will eventually slow the framerate if you go overboard.

Posted: Sat Jan 14, 2006 8:38 am
by crawmm
Either one actually. :D

Posted: Tue Jun 06, 2006 9:46 pm
by hansondr
Rackle wrote:The code in Samples/ParticleFX provides additional examples. Hopefully this can get you started:

Code: Select all

...
Dagon requires the following change:

from:

Code: Select all

ParticleSystem* sunParticle = ParticleSystemManager::getSingleton().createSystem("Sun", "Space/Sun");
to:

Code: Select all

ParticleSystem *sunParticle = mSceneMgr->createParticleSystem("Sun", "Space/Sun");

Posted: Wed Feb 06, 2008 12:53 am
by SAT
Mansur wrote:My flare.png
Can you put your flare.png back up? or a new link please?

Posted: Mon Jun 30, 2008 3:39 pm
by daanavitch
Every time I try to load a particle this error occurs:

An exception has occurred: OGRE EXCEPTION(2:InvalidParametersException): Cannot find required template 'Space/Sun' in ParticleSystemManager::createSystem at /Users/daan/ogre/Mac/Ogre/../../OgreMain/src/OgreParticleSystemManager.cpp (line 298)

What am I doing wrong?

Posted: Tue Jul 01, 2008 8:26 am
by xadhoom
Just "Sun"? Or do you miss to specifiy the folder in ressource.cfg. So Ogre can find the file...

Posted: Thu Jul 03, 2008 12:02 pm
by daanavitch
I found the solution. I had to put the .particle file in Ogremain/samples/media/particle

Re: Something like the Sun

Posted: Wed Mar 07, 2012 2:38 am
by vudy9900
Hey guys,

I am getting a similar error to what 'daanavitch' got - posted Tue Jul 01, 2008 2:39 am.

I am using Dell Inspiron 1520 Windows XP SP3 with MSVC++ 2010 Express and Ogre version 1.7.3

My code compiles but on run, it shows me an prompt box that says:

"OGRE EXCEPTION(2:InvalidParametersException): Cannot find required template 'Space/Sun' in ParticleSystemManager::createSystem at ..\..\..\..\OgreMain\src\OgreParticleSystemManager.cpp (line 327)"

I'd appreciate any help,
Thank You.

Kind Regards,
vudy9900

Re: Something like the Sun

Posted: Sun Mar 11, 2012 10:04 am
by vudy9900
Hey,

Just to continue from my last message,....

I have tried all the suggestions above but I still have this problem....

Would really appreciate for any help on this..

Thanks in advance.


vudy9900

Re: Something like the Sun

Posted: Sun Mar 11, 2012 11:19 am
by jheld
You've got the same problem as daanavich--
The Check your resources.cfg file in both bin/debug and bin/release folders (depending on what you're running)

Make sure your "FileSystem=..\..\media\particle" is uncommented,
then check that the particle file has Space/Sun and is in the right folder

Cheers
J