OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Above Water Fog artifacts.


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgOcean [osgOcean]
View previous topic :: View next topic  
Author Message
benang
User


Joined: 31 Jan 2011
Posts: 21

PostPosted: Fri Oct 07, 2011 8:08 am    Post subject:
Above Water Fog artifacts.
Reply with quote

Hi,

I've found some artifacts on the above water for scene shader.

1. When I tried implementing billboard tree with some transparent pixels, the transparent parts look not quite transparent. Like shown in the first picture.

I believe it's because of these lines in the osgOcean_ocean_scene.frag:
Code:
        float fogFactor = computeFogFactor( osgOcean_AboveWaterFogDensity, gl_FogFragCoord );
        final_color = mix( osgOcean_AboveWaterFogColor, final_color, fogFactor );


And when I added a line in that shader like this:
Code:
        float fogFactor = computeFogFactor( osgOcean_AboveWaterFogDensity, gl_FogFragCoord );
        final_color = mix( osgOcean_AboveWaterFogColor, final_color, fogFactor );
        final_color.a = textureColor.a;


It worked like in the second picture.

2. I believe the fog is only implemented to the objects but not the sky dome (as can be seen in the third picture). How do I make it also work with the sky dome? Thanks.



Thank you!

Cheers,
Bawenang

_________________
"There's no place like 127.0.0.1"
Back to top
View user's profile Send private message
kcbale
User


Joined: 04 Mar 2011
Posts: 68

PostPosted: Mon Oct 10, 2011 9:44 am    Post subject:
Above Water Fog artifacts.
Reply with quote

Hi Bawenang,


At a quick glance, I can see the problem mix problem. Thanks for reporting it.

With regard to the sky dome, you'll have to add the fogging code into the skydome shader, it can be found in the resources. The skydome was only really there for the example program and they've all be chosen to blend nicely with the fogging colour, obviously this doesn't suit all applications.

However, one problem with fogging the sky dome is that all of the sky with be fogged, essentially creating a flat colour since the sky dome (in the example app) will always be a fixed distance, moving with the camera.


K.




On 7 October 2011 09:08, Bawenang Rukmoko < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

I've found some artifacts on the above water for scene shader.

1. When I tried implementing billboard tree with some transparent pixels, the transparent parts look not quite transparent. Like shown in the first picture.

I believe it's because of these lines in the osgOcean_ocean_scene.frag:

Code:
       float fogFactor = computeFogFactor( osgOcean_AboveWaterFogDensity, gl_FogFragCoord );
       final_color = mix( osgOcean_AboveWaterFogColor, final_color, fogFactor );



And when I added a line in that shader like this:

Code:
       float fogFactor = computeFogFactor( osgOcean_AboveWaterFogDensity, gl_FogFragCoord );
       final_color = mix( osgOcean_AboveWaterFogColor, final_color, fogFactor );
       final_color.a = textureColor.a;



It worked like in the second picture.

2. I believe the fog is only implemented to the objects but not the sky dome (as can be seen in the third picture). How do I make it also work with the sky dome? Thanks.



Thank you!

Cheers,
Bawenang

------------------------
&quot;There's no place like 127.0.0.1&quot;

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43245#43245




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
benang
User


Joined: 31 Jan 2011
Posts: 21

PostPosted: Mon Oct 17, 2011 7:52 am    Post subject:
Re: Above Water Fog artifacts.
Reply with quote

kcbale wrote:
Hi Bawenang,


At a quick glance, I can see the problem mix problem. Thanks for reporting it.

With regard to the sky dome, you'll have to add the fogging code into the skydome shader, it can be found in the resources. The skydome was only really there for the example program and they've all be chosen to blend nicely with the fogging colour, obviously this doesn't suit all applications.

However, one problem with fogging the sky dome is that all of the sky with be fogged, essentially creating a flat colour since the sky dome (in the example app) will always be a fixed distance, moving with the camera.


K.




On 7 October 2011 09:08, Bawenang Rukmoko < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

I've found some artifacts on the above water for scene shader.

1. When I tried implementing billboard tree with some transparent pixels, the transparent parts look not quite transparent. Like shown in the first picture.

I believe it's because of these lines in the osgOcean_ocean_scene.frag:

Code:
       float fogFactor = computeFogFactor( osgOcean_AboveWaterFogDensity, gl_FogFragCoord );
       final_color = mix( osgOcean_AboveWaterFogColor, final_color, fogFactor );



And when I added a line in that shader like this:

Code:
       float fogFactor = computeFogFactor( osgOcean_AboveWaterFogDensity, gl_FogFragCoord );
       final_color = mix( osgOcean_AboveWaterFogColor, final_color, fogFactor );
       final_color.a = textureColor.a;



It worked like in the second picture.

2. I believe the fog is only implemented to the objects but not the sky dome (as can be seen in the third picture). How do I make it also work with the sky dome? Thanks.



Thank you!

Cheers,
Bawenang

------------------------
&quot;There's no place like 127.0.0.1&quot;

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43245#43245




_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



------------------
Post generated by Mail2Forum


OIC. I thought I can make the sky dome be fogged per pixel like the ocean surface does. But when I think about it, you were right. Nevertheless , I'll still try it though and see how will it become. Thanks.

_________________
"There's no place like 127.0.0.1"
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> osgOcean [osgOcean] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Artifacts on terrain generation with ... Trajce Nikolov NICK VirtualPlanetBuilder [vpb] 4 Fri Jun 13, 2014 2:44 pm View latest post
No new posts Artifacts with osgParticle::Precipita... snreddy General 0 Tue Feb 25, 2014 10:27 am View latest post
No new posts [SOLVED] Artifacts in terrain termite VirtualPlanetBuilder [vpb] 0 Tue Jan 07, 2014 7:46 pm View latest post
No new posts Artifacts with osgParticle::Precipita... snreddy General 0 Thu Dec 26, 2013 3:06 pm View latest post
No new posts Question about multipass rendering of... michael kapelko General 1 Mon Sep 30, 2013 4:20 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP