It is currently Sat Aug 22, 2020 4:26 am


All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: What am I doing wrong with these.... normals?
PostPosted: Mon Jul 14, 2014 9:28 pm 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
What is actually going here?
How can I get rid of these artifacts?

Attachment:
Clipboard01.jpg
Clipboard01.jpg [ 197.27 KiB | Viewed 5563 times ]

Attachment:
Clipboard02.jpg
Clipboard02.jpg [ 243.58 KiB | Viewed 5563 times ]

Attachment:
Clipboard03.jpg
Clipboard03.jpg [ 225.52 KiB | Viewed 5563 times ]


There is the shader:
http://sourceforge.net/p/kitten-platform/code/108/tree/trunk/game-wd/smooth.cg


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Tue Jul 15, 2014 8:26 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
It's hard to say exactly... you'll need to use some debugging tricks. For example, is it really the normals which are the problem? How does it look if you write the normals out as colours?

Also, what happens if you look at just one of the textures at a time? Is it always the same one which is stretched or do they all have that problem? Or what if you write out texture coordinates as colours - does this show you anything?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Tue Jul 15, 2014 8:35 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
They all have this stretch problem.
I have no idea what and why. I will post a screen shot of normals as colors... Also I'm not sure that problem comes from normals.

The problem is only seen on SOME perfectly horizontal or perfectly vertical planes and not all.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Tue Jul 15, 2014 11:35 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
This line looks odd:
Code:
float4 c1 = float4(VertexNormal.x, VertexNormal.x, VertexNormal.x, 1) * 0.5 + 1;

Did you really mean to use the .x component three times?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Tue Jul 15, 2014 3:52 pm 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
Yes. This is only a directional light so terrain looks more 3Dish. Without this line there is no lighting and still have artifacts :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Wed Jul 16, 2014 8:52 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, then I think you're going to need to visualize your normals and/or texture coordinates to see what's going on, and also try just applying a single texture at a time.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Wed Jul 16, 2014 9:43 am 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
The splatting code is perfect.

... and when I smoothed the density field with convolution kernel filter (own implementation), the "bleeding" has gone.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Fri Jul 18, 2014 9:06 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
petersvp wrote:
and when I smoothed the density field with convolution kernel filter (own implementation), the "bleeding" has gone.


Then it does sound like it could be a problem with the normals, but you'd still need to visualize it to really understand what is going on. PolyVox uses a central-difference method by default which can fail in certain situations. For example, I think that if you have voxels in a checkerboard pattern then it will have issues. I now know you actually have a binary volume, and I'm sure this will make computing normals from the volume data more difficult.

Of course, you don't have to use the provided normals, you could instead compute then yourself from the surrounding faces.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Mon Jan 19, 2015 1:21 pm 

Joined: Thu Oct 06, 2011 2:26 pm
Posts: 46
Location: Berlin
Hey, as our projects seem to be somewhat similar concerning terrain graphics, I wondered if or how you resolved this problem :)

I guess it could be resolved by manually fixing the normals the extractor outputs before creating an engine mesh out of it, but that would be very performance heavy.

_________________
My site! - Have a look :)
Also on Twitter - with more ketchup


Top
Offline Profile  
Reply with quote  
 Post subject: Re: What am I doing wrong with these.... normals?
PostPosted: Mon Jan 19, 2015 2:22 pm 

Joined: Tue Apr 08, 2014 5:10 pm
Posts: 124
I never resolved it :D I left them as is. smoothing the volume with custom low-pass filter made these artefacts not sooo noticeable. Also, I played with these hardcoded values in my shader.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net