Something like the Sun

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Mansur
Gnoblar
Posts: 7
Joined: Fri Dec 23, 2005 5:40 pm
Location: Germany

Something like the Sun

Post 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...
Last edited by Mansur on Fri Dec 23, 2005 8:40 pm, edited 1 time in total.
User avatar
steven
Gnoll
Posts: 657
Joined: Mon Feb 28, 2005 1:53 pm
Location: Australia - Canberra (ex - Switzerland - Geneva)
Contact:

Post 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.
Mansur
Gnoblar
Posts: 7
Joined: Fri Dec 23, 2005 5:40 pm
Location: Germany

Screenshot

Post by Mansur »

Image
draxd80
Gnoblar
Posts: 4
Joined: Sun Dec 25, 2005 12:41 am

Post by draxd80 »

Can you upload source of that nice looking SUN :) . I need something like that for little game i plan to make
User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: San Francisco
x 13
Contact:

Post 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! :)
Last edited by nikki on Mon Jun 30, 2008 3:40 pm, edited 1 time in total.
rookie1
Gnoblar
Posts: 2
Joined: Mon Dec 26, 2005 5:09 am

Post 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.
Mansur
Gnoblar
Posts: 7
Joined: Fri Dec 23, 2005 5:40 pm
Location: Germany

Post by Mansur »

draxd80
Gnoblar
Posts: 4
Joined: Sun Dec 25, 2005 12:41 am

Post 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*
User avatar
IFASS
Gnome
Posts: 387
Joined: Tue Jan 04, 2005 12:07 pm
Location: Netherlands

Post 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....
Image
User avatar
Robomaniac
Hobgoblin
Posts: 508
Joined: Tue Feb 03, 2004 6:39 am

Post by Robomaniac »

He already did, all you need is the .particle file he posted in the first post...
phear hingo

My Webpage
Rackle
Gnome
Posts: 375
Joined: Sat Jul 16, 2005 1:42 am
Location: Montreal

Post 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; 
} 
crawmm
Halfling
Posts: 51
Joined: Mon Oct 17, 2005 2:53 am
Location: Mojave Desert, CA

Post 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.
User avatar
ScurvyKnave
Gremlin
Posts: 150
Joined: Mon Oct 10, 2005 5:57 pm
Contact:

Post 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.
crawmm
Halfling
Posts: 51
Joined: Mon Oct 17, 2005 2:53 am
Location: Mojave Desert, CA

Post by crawmm »

Either one actually. :D
hansondr
Gnoblar
Posts: 1
Joined: Tue Jun 06, 2006 9:43 pm

Post 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");
SAT
Halfling
Posts: 64
Joined: Thu Aug 11, 2005 2:01 am

Post by SAT »

Mansur wrote:My flare.png
Can you put your flare.png back up? or a new link please?
daanavitch
Gnoblar
Posts: 11
Joined: Tue Jun 03, 2008 1:20 pm

Post 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?
User avatar
xadhoom
Minaton
Posts: 973
Joined: Fri Dec 28, 2007 4:35 pm
Location: Germany
x 1

Post by xadhoom »

Just "Sun"? Or do you miss to specifiy the folder in ressource.cfg. So Ogre can find the file...
daanavitch
Gnoblar
Posts: 11
Joined: Tue Jun 03, 2008 1:20 pm

Post by daanavitch »

I found the solution. I had to put the .particle file in Ogremain/samples/media/particle
vudy9900
Gnoblar
Posts: 2
Joined: Fri Feb 10, 2012 5:08 am

Re: Something like the Sun

Post 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
Attachments
This is a screenshot of my error
This is a screenshot of my error
vudy9900
Gnoblar
Posts: 2
Joined: Fri Feb 10, 2012 5:08 am

Re: Something like the Sun

Post 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
User avatar
jheld
Halfling
Posts: 90
Joined: Sat Feb 21, 2009 10:32 am

Re: Something like the Sun

Post 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
Post Reply