Board index FlightGear Development New features

3D OSG clouds - first step

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: 3D OSG clouds - first step

Postby Zan » Tue Jan 12, 2010 7:57 pm

Hi Stuart.

That's good to know, then no time should be wasted on that ;) But maybe the clouds could be rotated randomly about the 'up' axis if there is no shaders? Then it wouldn't probably look that errorneous...
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 10:28 am

Re: 3D OSG clouds - first step

Postby papillon81 » Fri Jan 15, 2010 5:53 pm

Hi,

I hope to get some help here. I switched my machine from the fglrx (proprietary) to the radeon opensource driver for my HD4670 card. To my surprise, it works really well with a very up-to date xorg stack (especially mesa from git). Even all shaders, except the 3dclouds one, work. The 3dclouds shader did not compile initially due to a "mat3x3" statement in 3dcloud.vert, which is not available in GLSL 1.10. Changing this to "mat3" makes it compile, but the 3d clouds do not show up. Instead I get a very strange view:
fgfs-screen-018.jpeg

Now I hope to get some help here from someone with more knowledge about shaders than me.

BTW: the fps here is very low because of a test with KMS enabled. When switching this off, I get almost the same FPS numbers I got with the fglrx driver.

Cheers,
Chris
Scenery guy. Currently working on: Terragear improvements for the 850 apt.dat format
Scenery Repo: http://gitorious.org/papillon81/flightgear-custom-scenery/"
papillon81
 
Posts: 175
Joined: Tue Apr 01, 2008 8:09 pm
Location: Frankfurt (EDDF), Germany
Callsign: D-PAP
Version: GIT
OS: Gentoo

Re: 3D OSG clouds - first step

Postby Gijs » Fri Jan 15, 2010 6:24 pm

Chris, looks like we finally got sunbeams, altough they do look a little ofheading! :D
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9355
Joined: Tue Jul 03, 2007 2:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: 3D OSG clouds - first step

Postby papillon81 » Fri Jan 15, 2010 6:58 pm

Well, you are right. However this only looks like this in a certain view and angle. When changing the angle it will look like single beams but not necessarily from one direction. And it changes in a matter of seconds...

Would be nice to get some help with this.
Scenery guy. Currently working on: Terragear improvements for the 850 apt.dat format
Scenery Repo: http://gitorious.org/papillon81/flightgear-custom-scenery/"
papillon81
 
Posts: 175
Joined: Tue Apr 01, 2008 8:09 pm
Location: Frankfurt (EDDF), Germany
Callsign: D-PAP
Version: GIT
OS: Gentoo

Re: 3D OSG clouds - first step

Postby stuart » Sat Jan 16, 2010 1:42 pm

Well, I'm pretty sure that changing a mat3x3 to mat3 isn't the right thing to do. However, from reading the vertex shader, that particular call is only used to determine some lighting variables, and so shouldn't affect the position of the sprites, which obviously is what is happening from your screenshot.

Assuming you're running CVS, can I suggest you change the code as follows:

Code: Select all
float n = dot(normalize(-gl_LightSource[0].position.xyz),
                normalize(mat3x3(gl_ModelViewMatrix) * (- gl_Position.xyz)));;


to

Code: Select all
float n = 0.9;


This will replace the lighting calculation with something much simpler.

Let me know if that makes any difference.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1587
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: 3D OSG clouds - first step

Postby papillon81 » Sat Jan 16, 2010 3:16 pm

Hi Stuart,

thanks for your help. Changing the shader changed indeed something. The clouds are still messed up, but it looks different now:
Image

I tested this with KMS enabled and disabled.

Hope you can make something out of this..

Cheers,
Chris
Scenery guy. Currently working on: Terragear improvements for the 850 apt.dat format
Scenery Repo: http://gitorious.org/papillon81/flightgear-custom-scenery/"
papillon81
 
Posts: 175
Joined: Tue Apr 01, 2008 8:09 pm
Location: Frankfurt (EDDF), Germany
Callsign: D-PAP
Version: GIT
OS: Gentoo

Re: 3D OSG clouds - first step

Postby planetacancun » Sun Jan 17, 2010 5:49 am

This video shows the new clouds in FG. So I see the difference between what I had and now. Thanks devs!

http://www.youtube.com/watch?v=k4oMOFnD6bw
planetacancun
 
Posts: 322
Joined: Thu Jul 30, 2009 4:52 pm
Callsign: Fallen-
IRC name: Fallen-
Version: GIT
OS: Ubuntu

Re: 3D OSG clouds - first step

Postby MaverickAlex » Sun Jan 17, 2010 10:25 am

nice video!

Really shows the true extent of the work done developing the clouds. uunfortunately my graphics card doesnt support them, but it great to see.
http://www.atlasvirtualairlines.com
Modeller of: TNCM TBPB MDPP TFFF TJSJ FMEE TKPK TFFG TQPF KLAX KATL EGNJ EGGW APACHE, EUROFIGHTER, HP VICTOR, DHC8
FGcom 122.75
creator Terragear GUI
User avatar
MaverickAlex
 
Posts: 1204
Joined: Sun Mar 23, 2008 4:46 pm
Location: Kingston Upon Hull. UK

Re: 3D OSG clouds - first step

Postby Liam » Sun Jan 17, 2010 12:02 pm

Mine doesn't support them either, but wow!
User avatar
Liam
 
Posts: 1905
Joined: Tue Dec 23, 2008 3:33 pm
Location: United Kingdom
Callsign: Liam
Version: GIT
OS: MAC OS X

Re: 3D OSG clouds - first step

Postby planetacancun » Sun Jan 17, 2010 8:52 pm

planetacancun wrote:This video shows the new clouds in FG. So I see the difference between what I had and now. Thanks devs!

http://www.youtube.com/watch?v=k4oMOFnD6bw


Thx guys. I do my best effort to make them be worthy of showing off here. I recorded this video like 4 times before it was good enough to show it here.

My 4 yo son loves to fly the F-16, and he was flying really fast through the clouds, and it does create an immersion effect with the high speed. Like really flying in the sky :D I'm going to try record a super fast video, maybe reducing the size so I can get more FPS. Like terminator said, "I'll be back!"
Callsign:Fallen-
Videos: http://youtube.com/planetacancun2
planetacancun
 
Posts: 322
Joined: Thu Jul 30, 2009 4:52 pm
Callsign: Fallen-
IRC name: Fallen-
Version: GIT
OS: Ubuntu

Re: 3D OSG clouds - first step

Postby stuart » Sun Jan 17, 2010 10:29 pm

papillon81 wrote:Hi Stuart,

thanks for your help. Changing the shader changed indeed something. The clouds are still messed up, but it looks different now:
http://img4.imageshack.us/i/fgfsscreen028.jpg

I tested this with KMS enabled and disabled.

Hope you can make something out of this..

Cheers,
Chris


I'm stumped, I'm afraid.

The change I suggested should have just changed the lighting, not the geometry of the clouds. Are there any other error messages?

I think there must be something broken in your cards GLSL implementation.

Sorry I can't do anything more.

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1587
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: 3D OSG clouds - first step

Postby planetacancun » Fri Jan 22, 2010 6:32 am

My last video to show off the clouds on an F-16. I called it Vertigo Flying Low :)

http://www.youtube.com/watch?v=dSqjA5YKoEk

Excellent clouds.
Callsign:Fallen-
Videos: http://youtube.com/planetacancun2
planetacancun
 
Posts: 322
Joined: Thu Jul 30, 2009 4:52 pm
Callsign: Fallen-
IRC name: Fallen-
Version: GIT
OS: Ubuntu

Re: 3D OSG clouds - first step

Postby papillon81 » Mon Feb 01, 2010 10:31 pm

Stuart,

I just tried the 3d clouds again and it seems like the xorg driver has again made some progress. When I now apply your changes, the 3d clouds work correctly:

Image

The fps rate drops considerably, but still it works :) I dunno if we should just wait for xorg/mesa to further improve their shader support instead of doing changes to our stuff. The new stencil shaders do not compile currently. Will debug that too.

Cheers,
Chris
Scenery guy. Currently working on: Terragear improvements for the 850 apt.dat format
Scenery Repo: http://gitorious.org/papillon81/flightgear-custom-scenery/"
papillon81
 
Posts: 175
Joined: Tue Apr 01, 2008 8:09 pm
Location: Frankfurt (EDDF), Germany
Callsign: D-PAP
Version: GIT
OS: Gentoo

Re: 3D OSG clouds - first step

Postby eotunun » Thu May 06, 2010 10:07 pm

I took a closer look at Flight Simulator X the recent days, and found that you lot bat the s*** out of the Microsofties when it comes to the look of clouds. Excelent work!
User avatar
eotunun
 
Posts: 17
Joined: Fri Apr 23, 2010 10:50 am
Callsign: D-ENUN

Re: 3D OSG clouds - first step

Postby kyokoyama » Sun May 09, 2010 3:44 am

Papillon81, if you look closely, some of the clouds touch the grounds...?
Look for "B-BIRD" "N127KY" or "AVA0004" -that's me.

Despite having over 1700 posts here, I am not even close to being the most skilled guy here... I'm just words and bad drawing, not experience. :P
kyokoyama
 
Posts: 1981
Joined: Sun May 03, 2009 2:16 am
Location: Earth
Callsign: B-BIRD, N127KY
Version: 2.12.1
OS: Windows Vista

PreviousNext

Return to New features

Who is online

Users browsing this forum: No registered users and 2 guests