CGCookie / retopoflow

A suite of retopology tools for Blender
2.53k stars 250 forks source link

Please add Backface cull mode. #524

Closed Sinhouse85 closed 6 years ago

Sinhouse85 commented 6 years ago

I'm using retopoflow to retopologise complex folds out of marvelous designer. Everything is fine while working on the front side of an object, However once rotating to the back and looking through the mesh to the backfaces of your retopo mesh, it becomes very difficult to see what I am doing. capture

carter2422 commented 6 years ago

@Sinhouse85 you can use the Clip Start and Clip End value sliders under General settings to adjust the front and back face visibility.

Be sure you're using the RetopoFlow 2 beta.

vxlcoder commented 6 years ago

Thanks for the report, @Sinhouse85.

Unfortunately this issue stems from a deeper issue that we don't have a good solution to at the moment. Adding a "Hide Backfaces" option isn't hard (I'll probably add it when I get a chance), but you'll see other problems still evident here.

As a workaround, try doing these two things:

Please let me know if either of theses work, and I'll see about adding a Hide Backface option as another workaround.

Thanks!

Sinhouse85 commented 6 years ago

Hi carter, thanks for your reply! However, this seems like a bit of a sloppy solution to a very simple problem. I have to set the clipping tolerances so fine that I keep losing my mesh if I zoom in or out. A simple backface cull would solve the issue and be depth plane independent.

Sinhouse85 commented 6 years ago

@vxlcoder Thanks for the reply and your temporary workaround. I shall give it a go. :)

Ideally I don't want to be messing with object scale so that I don't have to keep editing scale before baking.

carter2422 commented 6 years ago

Just to be sure, what is the current dimensions of your object?

The clipping settings are the same as Blenders viewport clipping, and so if the margin between the start and end is proving difficult to get right then it’s most likely the model is too large. The RetopoFlow behavior is identical to that of Blenders viewport, with the exception that we are trying to draw the mesh on top of all surfaces (which is where the backface gets tricky).

Sinhouse85 commented 6 years ago

@carter2422 Unfortunately I'm not actually a blender user, I'm a 3ds Max man by trade. I just came here for the retopo :) As such I don't actually know where to find out my current object scale in blender. It was correctly scaled in max to fit to human proportions, but there might be some scale conversion mismatch happening on import.

carter2422 commented 6 years ago

Welcome to the Blender world!

You can find the object dimensions via the Viewport Properties bad, under the Transform panel while in Object Mode. Open the properties bar with N.

Often times imports will come in with a factor scale, sometimes 100x too large.

One Blender unit is equal to one meter, so your object ought to be somewhere in the 1-2 range on the Z height.

vxlcoder commented 6 years ago

Totally agree with you, @Sinhouse85. RF should handle all that it can so you don't have to think about these things :)

I have plans for handling better cases like this (and it's not a perfect solution... a built-in workaround), but I haven't spent time on implementing it, because it will be a little tricky to get right. Maybe I'll raise the priority on this.

Technical details: this is a fundamental issue with how raster graphics works. So, all of Blender or 3DSMax or Maya or any video game will have this problem at some level. The problem is knowing what is on top of the surface and what is below / behind. Raster graphics uses a clever hack (z depth) to try to guess at an answer, but it breaks down when precision gets in the way (scaling of objects is too large or too small) or when the surfaces are in the same location, as they are with retopology work (want target to match as perfectly as possible the original source).

To clarify my "you'll see other problems still evident here", reference the screenshot below. The red square highlights an area that backface culling will not correct, but the green square will.

image

Thanks again for the report! We are genuinely interested in how artists are using RF and where RF is needing some more work! We would love to hear about your experience. (working on getting an email address set up right now for experience feedback discussion)

Sinhouse85 commented 6 years ago

Ok cool, and thanks for the welcome! I'm hoping to make a full transition, as I have just gone freelance and Autodesk can go do one if they think I'm paying for a Max licence ;) Anyway. My object is roughly: X30cm Y21cm Z46cm

carter2422 commented 6 years ago

What do the XYZ Scale values show? If they're anything other than 1,1,1 then in Object Mode press CtRL+A > Apply Scale. This will reset the scale factor to 1 while keep the current size.

Sinhouse85 commented 6 years ago

@vxlcoder Yes I fully expect that backface would be an imperfect solution, and on areas of extreme overlap like you have highlighted in red I would still have issues from that camera angle. However moving the camera to better frame that area would likely resolve them.

vxlcoder commented 6 years ago

Ah, yes that's very large to how RF is rendering the meshes. Try scaling down your meshes by 0.1 (in object mode, select all (A), scale (S), type 0.1 enter). You could scale it down further if needed.

Do you by chance get a "warning" in the RetopoFlow Panel like the one below? image

Sinhouse85 commented 6 years ago

@carter2422 capture_02

Sinhouse85 commented 6 years ago

@vxlcoder I do indeed have that warning. Sorry I didn't notice until you pointed it out.

Sinhouse85 commented 6 years ago

@carter2422 @vxlcoder Ok after scaling down the Target Alpha Below slider actually does something and solves my issue! Hoorah! capture_03 However, as I said before. Ideally I would not be messing with object scale, and 46cm tall is in no way large for an object.

vxlcoder commented 6 years ago

You are right, @Sinhouse85. In this case, the human-understandable units is confusing. What matters is the magnitude in Blender Units. This is what RF uses. Regardless, I'm working on the built-in workarounds right now (backface culling option and auto-scaling).

Although it isn't ideal, I'm glad to hear that this workaround is working for you!

Let us know if you run across any other issues.

Sinhouse85 commented 6 years ago

@carter2422 @vxlcoder Just have to commend you guys on your fantastic support BTW! It makes me even more happy with my decision to buy retopoflow. Also just in case your interested, here is a link to my artstation so can see a bit of my background. https://www.artstation.com/sinhouse

carter2422 commented 6 years ago

Thanks for baring with us @Sinhouse85!

Are you by chance using Centimeters as the scene units? https://cl.ly/t1XD

If so then your model is displaying in centimeters but for all intents and purposes is still very large in Blender. Units presets are not really Blender's strong suit.

If you want to know how large your model actually is, in Blender Units, then set the preset back to Meters. At which point I suspect it's saying that it's 46meters tall.

Sinhouse85 commented 6 years ago

@carter2422 Switching back to meters, after the 0.1 scale was applied its still saying its 4.6 meters tall. So yea pretty big then :) I think I need to better understand how Blender does things.

vxlcoder commented 6 years ago

commit b6d8b57 adds a backface culling option to the General options panel (below the Target Alpha settings). ready for testing!

Sinhouse85 commented 6 years ago

Awesome! cheers.

Sinhouse85 commented 6 years ago

I may be doing something wrong, but blender just throws an error when trying to turn this on in the addons panel. capture_04

vxlcoder commented 6 years ago

looking into this...

vxlcoder commented 6 years ago

how did you install this last commit? what steps did you take?

Sinhouse85 commented 6 years ago

I downloaded the ZIP file, Then targeted it from within the install addons button within blender.

Sinhouse85 commented 6 years ago

This is how it displays in the addons panel if that helps. capture_05

vxlcoder commented 6 years ago

Ok. I just tried that, but didn't get that error. Did you uninstall the other versions of RF?

Oh! It might be a Windows thing. (I haven't fully tested Windows with some recent changes) Let me dig some more.

Sinhouse85 commented 6 years ago

I unchecked all other versions if that's what you mean.

vxlcoder commented 6 years ago

ok, @Sinhouse85... commit 29f3418 should fix it. Please let me know if you still have problems!

Sinhouse85 commented 6 years ago

Ok, Thanks. I will give it a go! :)

Sinhouse85 commented 6 years ago

All working guys. This is much better, even with everything back at original scale. Thank you so much for addressing this so quickly! it will make the rest of this retopo job that bit less soul destroying. ;) capture_06

carter2422 commented 6 years ago

That's so great to hear @Sinhouse85!

If you're willing we'd love to see your work when it's done. Perhaps you could send some samples to jonathan@cgcookie.com?

Please do keep reporting issues/requests as you find them. Power users input is very welcome.

Sinhouse85 commented 6 years ago

@carter2422 I'd love to share my work when I can. However this piece is part of an unannounced game, so may be tricky right away. I will see what I can do.

Thanks again to both of you!

Sinhouse85 commented 6 years ago

@vxlcoder For some reason the "Target Below Alpha" setting has stopped having an effect again, causing a lot of the readability issues to return.

Sinhouse85 commented 6 years ago

Hi guys,

Are either of you on Discord by any chance? I would like to talk to you about a couple of things. I have had some quite serious issues with retopoflow today.

On 17 July 2018 at 18:10, Jonathan Williamson notifications@github.com wrote:

That's so great to hear @Sinhouse85 https://github.com/Sinhouse85!

If you're willing we'd love to see your work when it's done. Perhaps you could send some samples to jonathan@cgcookie.com?

Please do keep reporting issues/requests as you find them. Power users input is very welcome.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CGCookie/retopoflow/issues/524#issuecomment-405656905, or mute the thread https://github.com/notifications/unsubscribe-auth/Ana612qFyLgLWsAxG6vKZKBds-hPt6Rpks5uHhp6gaJpZM4VS6iJ .

carter2422 commented 6 years ago

We are not on Discord.

What're the issues you're having and which branch are you testing in?

I recommend you stick with the release/2.0.0 branch, as common_refactor and super-secret-new-tool are not yet ready. Each of those branches have a bunch of improvements but have also introduced some issues, such as the Relax math causing weird results.

Sinhouse85 commented 6 years ago

Well after thinking I had finalized my retop, I exported to obj to bring back into 3ds max. However the mesh was seriously corrupted, with missing faces, disconnected edges and broken normals. I also saw a return of the readability issues I was seeing the other day from the Target Alpha Below slider having no effect.

On 19 July 2018 at 20:44, Jonathan Williamson notifications@github.com wrote:

We are not on Discord.

What're the issues you're having and which branch are you testing in?

I recommend you stick with the release/2.0.0 branch, as common_refactor and super-secret-new-tool are not yet ready. Each of those branches have a bunch of improvements but have also introduced some issues, such as the Relax math causing weird results.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CGCookie/retopoflow/issues/524#issuecomment-406392024, or mute the thread https://github.com/notifications/unsubscribe-auth/Ana619QKVoMiCVJ4K0TTb167y0KqOdNiks5uIOGTgaJpZM4VS6iJ .

Sinhouse85 commented 6 years ago

Oh and I was using the branch with added backface cull, but not the adjusted relax.

On 19 July 2018 at 20:48, Jack Perry jack.perry85@googlemail.com wrote:

Well after thinking I had finalized my retop, I exported to obj to bring back into 3ds max. However the mesh was seriously corrupted, with missing faces, disconnected edges and broken normals. I also saw a return of the readability issues I was seeing the other day from the Target Alpha Below slider having no effect.

On 19 July 2018 at 20:44, Jonathan Williamson notifications@github.com wrote:

We are not on Discord.

What're the issues you're having and which branch are you testing in?

I recommend you stick with the release/2.0.0 branch, as common_refactor and super-secret-new-tool are not yet ready. Each of those branches have a bunch of improvements but have also introduced some issues, such as the Relax math causing weird results.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CGCookie/retopoflow/issues/524#issuecomment-406392024, or mute the thread https://github.com/notifications/unsubscribe-auth/Ana619QKVoMiCVJ4K0TTb167y0KqOdNiks5uIOGTgaJpZM4VS6iJ .

carter2422 commented 6 years ago

Which branch were you using? I suspect those mesh issues are much of the same reason Relax is causing strange issues.

@vxlcoder we need to confirm that normals and doubles are being properly accounted for.

As for Target Alpha Below, this will only show differences if your Clip Start/End are appropriately set. I realize it's super confusing how each of these interact with one another, but that's just the nature of how Blender handles clipping.

I hope you'll bare with us as we're still making some fairly significant changes on these particular settings to find a good balance.

carter2422 commented 6 years ago

Target Alpha Below also won't do much if you have Backfaces Culled, since the Below will mostly be comprised of backfaces.

Sinhouse85 commented 6 years ago

Actually it helped quite a lot in addition to the backface cull when it was working.

On 19 July 2018 at 20:53, Jonathan Williamson notifications@github.com wrote:

Target Alpha Below also won't do much if you have Backfaces Culled, since the Below will mostly be comprised of backfires.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CGCookie/retopoflow/issues/524#issuecomment-406394543, or mute the thread https://github.com/notifications/unsubscribe-auth/Ana612TMHVfcOo7zIL9Me7sO2NhRERxlks5uIOPQgaJpZM4VS6iJ .

carter2422 commented 6 years ago

Are you able to send over the model in question privately? If so then you can send it to jonathan@cgcookie.com and I'll take a look at the corruption issue.

Sinhouse85 commented 6 years ago

Sorry you are right about the clipping values, I forgot about changing them to see an effect in the alpha. However, here are images with and without target below alpha. Both with backface culling.

On 19 July 2018 at 20:54, Jack Perry jack.perry85@googlemail.com wrote:

Actually it helped quite a lot in addition to the backface cull when it was working.

On 19 July 2018 at 20:53, Jonathan Williamson notifications@github.com wrote:

Target Alpha Below also won't do much if you have Backfaces Culled, since the Below will mostly be comprised of backfires.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CGCookie/retopoflow/issues/524#issuecomment-406394543, or mute the thread https://github.com/notifications/unsubscribe-auth/Ana612TMHVfcOo7zIL9Me7sO2NhRERxlks5uIOPQgaJpZM4VS6iJ .

carter2422 commented 6 years ago

Your images didn't come through. I don't believe reply-by-email supports attachments.

You may need to comment directly on GitHub: https://github.com/CGCookie/retopoflow/issues/524#issuecomment-406394886

Sinhouse85 commented 6 years ago

Sorry. here are the attachments. capture_02 capture_01

carter2422 commented 6 years ago

This looks to be acting exactly as it should.

The Below Alpha adjusts the opacity of any retopoflow geometry that's behind (below) another surface, regardless of whether it is a front or back face.

Maybe I'm confused as to the issue you're having?

Sinhouse85 commented 6 years ago

No, no confusion. As I said above, I had not correctly set the clipping values. (my bad). I was just pointing out that it had a valued effect beyond the backface culling. :)

vxlcoder commented 6 years ago

Sorry to hear about the issues, @Sinhouse85. Can you send @carter2422 the .blend file of the final retopo'd mesh and the .obj file you exported? I'd like to take a look at the files closely.

Sinhouse85 commented 6 years ago

I think a lot of the mesh Issues I was getting are due to my use of PolyPen. Which by the way was my primary tool of choice. I think that double faces were being created in certain areas, with additional edges sitting below but not properly connected to an existing flow. I think the fact that the retopo mesh faces are so transparent masks this issue, where I might have otherwise spotted it. Perhaps it would be useful to put a base tint colour on unselected faces and maybe add a transparencey slider for retopo mesh faces too. The corruption that I mentioned is probably just the obj or fbx exporter freaking out because of being given a dodgy mesh, rather than anything inherently wrong with your code.

carter2422 commented 6 years ago

Since this seems to be working very well now, and the mesh issues were separate @Sinhouse85 I'm going to close this.

If you come across any further Backface issues please don't hesitate to log a new issue.