It is currently Wed Jan 29, 2020 8:44 pm

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: CubicSurfaceExtractor + keep corner vertices separatedPosted: Fri May 29, 2015 7:17 pm

Joined: Wed Jul 23, 2014 7:54 pm
Posts: 7
Hey there.

I am currently trying to use CubicSurfaceExtractor, and the fact that I can't pre-generate normals has been daunting so far. I'm trying to do it in the shader the way it's suggested:

float3 worldNormal = cross(ddy(inWorldPosition.xyz), ddx(inWorldPosition.xyz));
worldNormal = normalize(worldNormal);

But that is not perfect, and a straight wall that is made from, say, 3 rectangles is not lit consistently (one of the quads will be brighter, for example).

Is there a way to prevent CubicSurfaceExtractor from merging corner vertices? That way I could simply generate vertices the good old way and have consistant lighting.

Cheers.

Top

 Post subject: Re: CubicSurfaceExtractor + keep corner vertices separatedPosted: Fri May 29, 2015 8:10 pm
 Developer

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
kamac wrote:
But that is not perfect, and a straight wall that is made from, say, 3 rectangles is not lit consistently (one of the quads will be brighter, for example).

Can you elaborate on why this is a problem, and or show a picture? We use this approach in Cubiquity without any problems.

kamac wrote:
Is there a way to prevent CubicSurfaceExtractor from merging corner vertices? That way I could simply generate vertices the good old way and have consistant lighting.

There is no method of doing this, but I guess you could take the generated mesh and then split it up in your own code. You'll need to calculate you own normals though as the CubicSurfaceExtractor doesn't generate any.

Top

 Post subject: Re: CubicSurfaceExtractor + keep corner vertices separatedPosted: Fri May 29, 2015 9:23 pm

Joined: Wed Jul 23, 2014 7:54 pm
Posts: 7
Well, I'm basically using it with unity 5 physically based shading, which is smooth, not flat and that probably causes the lighting errors.

Nevermind me though. For my purpose (simple, colored voxels) it was just better & easier to write the thing using internet resources myself (it's just 130 lines anyway).

Polyvox seems like a good idea as long as you don't want optimized, colored voxels :S (for everything else it's very nice)

Top

 Post subject: Re: CubicSurfaceExtractor + keep corner vertices separatedPosted: Mon Nov 09, 2015 4:49 pm

Joined: Sun May 18, 2014 10:52 pm
Posts: 43
kamac wrote:
Polyvox seems like a good idea as long as you don't want optimized, colored voxels :S (for everything else it's very nice)

Clearly I've got a better grasp on shaders than you do, I've been coding them for 1 day.

I thought I had the same problem with texturing, however you're doing this for lighting, so I'm not so sure I can help you with the code, but I assure you it can be corrected. It's probably related to the way you're handling the texture.

Perhaps this post sheds some light on the subject? (no pun in ten did)

viewtopic.php?f=14&t=659

particularly have a look at the bugs I discuss there, could be related?

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ General Discussion Forums    General Discussion PolyVox Forums    PolyVox Discussion    PolyVox Bugs    Showcase Cubiquity Forums    Cubiquity Discussion Voxeliens Forums    Voxeliens Discussion    Voxeliens Support