Something like the Sun

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.

Something like the Sun

Postby Mansur » Fri Dec 23, 2005 6:10 pm

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.
Mansur
Gnoblar
 
Posts: 7
Kudos: 0
Joined: 23 Dec 2005
Location: Germany

Postby steven » Fri Dec 23, 2005 7:56 pm

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.
User avatar
steven
Gnoll
 
Posts: 657
Kudos: 0
Joined: 28 Feb 2005
Location: Australia - Canberra (ex - Switzerland - Geneva)

Screenshot

Postby Mansur » Sat Dec 24, 2005 11:47 am

Image
Mansur
Gnoblar
 
Posts: 7
Kudos: 0
Joined: 23 Dec 2005
Location: Germany

Postby draxd80 » Sun Dec 25, 2005 12:43 am

Can you upload source of that nice looking SUN :) . I need something like that for little game i plan to make
draxd80
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 25 Dec 2005

Postby nikki » Sun Dec 25, 2005 10:40 am

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.
User avatar
nikki
Old One
 
Posts: 2730
Kudos: 12
Joined: 17 Sep 2005
Location: Princeton, New Jersey, USA

Postby rookie1 » Mon Dec 26, 2005 5:12 am

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.
rookie1
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 26 Dec 2005

Postby Mansur » Mon Dec 26, 2005 8:08 am

Mansur
Gnoblar
 
Posts: 7
Kudos: 0
Joined: 23 Dec 2005
Location: Germany

Postby draxd80 » Mon Dec 26, 2005 3:01 pm

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*
draxd80
Gnoblar
 
Posts: 4
Kudos: 0
Joined: 25 Dec 2005

Postby IFASS » Mon Dec 26, 2005 6:22 pm

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
IFASS
Gnome
 
Posts: 395
Kudos: 0
Joined: 04 Jan 2005
Location: Netherlands

Postby Robomaniac » Mon Dec 26, 2005 6:23 pm

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

My Webpage
User avatar
Robomaniac
Orc Shaman
 
Posts: 736
Kudos: 0
Joined: 03 Feb 2004

Postby Rackle » Fri Jan 06, 2006 1:53 am

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;
}
Rackle
Gnome
 
Posts: 374
Kudos: 0
Joined: 16 Jul 2005
Location: Montréal

Postby crawmm » Fri Jan 06, 2006 6:37 am

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.
crawmm
Halfling
 
Posts: 51
Kudos: 0
Joined: 17 Oct 2005
Location: Mojave Desert, CA

Postby ScurvyKnave » Fri Jan 13, 2006 7:19 pm

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.
User avatar
ScurvyKnave
Gremlin
 
Posts: 150
Kudos: 0
Joined: 10 Oct 2005

Postby crawmm » Sat Jan 14, 2006 8:38 am

Either one actually. :D
crawmm
Halfling
 
Posts: 51
Kudos: 0
Joined: 17 Oct 2005
Location: Mojave Desert, CA

Postby hansondr » Tue Jun 06, 2006 9:46 pm

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");
hansondr
Gnoblar
 
Posts: 1
Kudos: 0
Joined: 06 Jun 2006

Postby SAT » Wed Feb 06, 2008 12:53 am

Mansur wrote:My flare.png

Can you put your flare.png back up? or a new link please?
SAT
Halfling
 
Posts: 64
Kudos: 0
Joined: 11 Aug 2005

Postby daanavitch » Mon Jun 30, 2008 3:39 pm

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?
daanavitch
Gnoblar
 
Posts: 11
Kudos: 0
Joined: 03 Jun 2008

Postby xadhoom » Tue Jul 01, 2008 8:26 am

Just "Sun"? Or do you miss to specifiy the folder in ressource.cfg. So Ogre can find the file...
User avatar
xadhoom
Minaton
 
Posts: 973
Kudos: 2
Joined: 28 Dec 2007
Location: Germany

Postby daanavitch » Thu Jul 03, 2008 12:02 pm

I found the solution. I had to put the .particle file in Ogremain/samples/media/particle
daanavitch
Gnoblar
 
Posts: 11
Kudos: 0
Joined: 03 Jun 2008

Re: Something like the Sun

Postby vudy9900 » Wed Mar 07, 2012 2:38 am

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
ogre1.0.PNG
This is a screenshot of my error
vudy9900
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 10 Feb 2012

Re: Something like the Sun

Postby vudy9900 » Sun Mar 11, 2012 10:04 am

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
vudy9900
Gnoblar
 
Posts: 2
Kudos: 0
Joined: 10 Feb 2012

Re: Something like the Sun

Postby jheld » Sun Mar 11, 2012 11:19 am

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
User avatar
jheld
Halfling
 
Posts: 89
Kudos: 0
Joined: 21 Feb 2009


Return to Using OGRE in practice

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests