CCloudSceneNode - clouds with levels of detail

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: CCloudSceneNode - clouds with levels of detail

Post by hybrid »

Also, we have irrext project, where all such projects can be hosted for unlimited access. But community has to take at least some work.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

Yes but how to make that happen... inspiration?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: CCloudSceneNode - clouds with levels of detail

Post by hybrid »

If someone wrote an extension which more than a few people think is useful, we (i.e. Irrlicht admins) will add the user to the irrext project, where he can place his software and continue development with all benefits from SF.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

That would be good but I wonder if the skill level needed to take Irrlicht forward is beyond casual / part-time involvement.

Okay, Linux was to a large extent developed that way but it was also developed by and for universities, whose staff had salaries.

If one or two of you dedicated 5 days time you could add back the weather manager, true environment mapping, reflective surfaces etc., and maybe even include the latest DX11 driver, if those involved wanted to release their code updates.

That would give Irrlicht a major boost, but only if some exmples, as per 3D Labs from 2005, were included, which they could be quite easily.

I feel that if some of you don´t do that Irrlicht will continue to loose steam... which would be really a shame given all the effort to date.

Well, if its worth anything that´s my view.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: CCloudSceneNode - clouds with levels of detail

Post by hybrid »

Well, this thread here is about the cloud scene node, so please leave it for this. If you feel to provide constructive criticism or useful suggestions, please find a thread over at the open discussion forum - or create a new one there.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

Okay, so is the irrWeathermanager open source because there are comments in the source saying its :-

irrWeatherManager weather system for the Irrlicht rendering engine.
Copyright (C) 2009-2010 Josiah Hartzell (Skyreign Software)
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

and :-

// Copyright (C) Pazystamo
// This file is part of the "irrWeatherManager" weather management library for the Irrlicht rendering engine.
// The code in this file was separated from its original file, and the code belongs to Pazystamo from the Irrlicht forums.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

and not sure if anyone can really copyright what is little more than standard 3D procedures, many of which are snippets from other people that was freely distributed.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: CCloudSceneNode - clouds with levels of detail

Post by hybrid »

Not sure where you are from, but most parts of the free world support a rather complete copyright system. Which means that most things that are produced by someone is automatically copyrighted. The hurdle to jump there is rather low, innovation starts almost immediately when writing things. I think I have the original wheather scene node from Pazystamo somewhere on my hdd, I think he gave this code free after the project was closed down.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

If only life were so simple. Let us know maybe sometime if it is open source or not.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

Have found a little bug in the ICloudscenenode:-

Code: Select all

//! render
void ICloudSceneNode::render()
{
    video::IVideoDriver* driver = SceneManager->getVideoDriver();
    ICameraSceneNode* camera = SceneManager->getActiveCamera();
 
    if (!camera || !driver)
        return;
 
    // Calculate vectors for letting particles look to camera
 
// Robmar comment ?????? This may need a mod to stop clouds rotating with camera when view direction is up to sky!
    core::vector3df campos = camera->getAbsolutePosition();
    core::vector3df target = camera->getTarget();
    core::vector3df up = camera->getUpVector();
    core::vector3df view = target - campos;
    view.normalize();
 
    core::vector3df horizontal = up.crossProduct(view);
    horizontal.normalize();
 
    core::vector3df vertical = horizontal.crossProduct(view);
    vertical.normalize();
 
Now this code works okay until the camera looks up at the sky, right up, then spins around. Like as if you stand in a field, look up at the clouds, and spin yourself around...

The IClouds track the camera alright, but they spin with it too, causing a weird effect, that of the clouds spinning with you... the clouds start spinning in space, which is clearly not very realistic.

So for those geometrically minded its just a matter of having the clouds facing to camera, but stopping them rotating with it....

I think we need to mod the Up vector so that it does not rotate the clouds.... mmmm
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

Clouds need a horizontal vector based around sky top centre (0,1,0) : whichever side they are off the top 0,1,0 should be their horizon.

When exactly at 0,1,0 their horizon could be fixed along the X-axis 1,0,0.

So, a bit of vector math and the clouds will stop spinning in space
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: CCloudSceneNode - clouds with levels of detail

Post by robmar »

This seems to be a very quick fix for this issue:-

Code: Select all

 
up = core::vector3df(0.f,1.f,0.f);      // Fix up vector to stop spin-tracking of camera (clouds now only spin when camera tracks across the sky top spot (0,1,0) )
    core::vector3df horizontal = up.crossProduct(view);
    horizontal.normalize();
 
This removes the camera-cloud spin connection and works well until the gaze of the camera cross sky top spot (at maximum elevation).

Anyone interested in having a good cloud system... or has the code now been completed and only shared for those developing commercial games...? :)
Post Reply