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 

Strips on AnimatedTexturing on Terrain by GLSL


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
?mit Uzun
Guest





PostPosted: Fri Oct 17, 2008 8:36 am    Post subject:
Strips on AnimatedTexturing on Terrain by GLSL
Reply with quote

Hi All,

I had created animated texturing on terrain with using shaders but I have already realized some artifacts on the terrain as you see from that VIDEO. Why have this strips created on the terrain in each loop?
Any advices to get rid of them ?

Note : In vertex shader I only iterate the caustics texture x coordinate by the way,

causticsCoords = gl_MultiTexCoord0.xy;;
causticsCoords.x = fract( causticsCoords.x + float( timeValue * causticsSpeed ) );

All of the important pattern about animating texture on terrain is preceeded dodes.

Best Regards.

Umit Uzun

------------------
Post generated by Mail2Forum
Back to top
David Spilling
Guest





PostPosted: Fri Oct 17, 2008 9:22 am    Post subject:
Strips on AnimatedTexturing on Terrain by GLSL
Reply with quote

Umit,

It's a well known gotcha with texture repeats.

Each vertex has increasing causticsCoord.x. Imagine the vertices with coord 0.0, 0.1, 0.2, 0.3 etc. The fragments in between any of these coords have _interpolated_ texcoords i.e. a fragment halfway betwen 0.0 and 0.1 vertex has a texcoord of 0.05.

For the end vertices, you have 0.8,0.9,1.0, 1.1. The fract function turns this into 0.8, 0.9, 0.0, 0.1

Hence a fragment half way between 0.9 and 1.0 interpolates the texcoord between 0.9 and 0.0, giving 0.45, not 0.95 as you would want. Between 0.9 and "1.0", then the actual texcoord used decreases rapidly from 0.9 to 0.0.

The artifact you see is all of your caustics texture, mirrored, and shoved into the last vertex gap.

To get rid if it, try losing the "fract" instruction. There may also be dependencies on your texture mode (REPEAT, MIRROR, CLAMP) that you might need to play with depending on what your texture looks like.

Hope that helps,

David

------------------
Post generated by Mail2Forum
Back to top
?mit Uzun
Guest





PostPosted: Fri Oct 17, 2008 11:22 am    Post subject:
Strips on AnimatedTexturing on Terrain by GLSL
Reply with quote

Hi David,

I unattached the fract math function and all strips gone away Smile I haven't thought it was a simple bug Smile

Thanks so much.
Best regards.

Umit Uzun

2008/10/17 David Spilling < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Quote:
Umit,

It's a well known gotcha with texture repeats.

Each vertex has increasing causticsCoord.x. Imagine the vertices with coord 0.0, 0.1, 0.2, 0.3 etc. The fragments in between any of these coords have _interpolated_ texcoords i.e. a fragment halfway betwen 0.0 and 0.1 vertex has a texcoord of 0.05.

For the end vertices, you have 0.8,0.9,1.0, 1.1. The fract function turns this into 0.8, 0.9, 0.0, 0.1

Hence a fragment half way between 0.9 and 1.0 interpolates the texcoord between 0.9 and 0.0, giving 0.45, not 0.95 as you would want. Between 0.9 and "1.0", then the actual texcoord used decreases rapidly from 0.9 to 0.0.

The artifact you see is all of your caustics texture, mirrored, and shoved into the last vertex gap.

To get rid if it, try losing the "fract" instruction. There may also be dependencies on your texture mode (REPEAT, MIRROR, CLAMP) that you might need to play with depending on what your texture looks like.

Hope that helps,

David



_______________________________________________
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
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General 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 Use PNG as texture for terrain in osg... Rodrigo General [3rdparty] 12 Mon Jan 07, 2019 5:13 pm View latest post
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 am View latest post
No new posts osg-users Digest, Vol 138, Issue 27 Zachary1234 General 0 Tue Jan 01, 2019 1:16 am View latest post
No new posts pass mat4 as attribute for glsl sirian_ye General 4 Tue Nov 27, 2018 4:58 am View latest post
No new posts osg-users Digest, Vol 137, Issue 14 poweruserm@live.com.au General 0 Fri Nov 16, 2018 11:16 pm 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