Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 10
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 717 times and has 9 replies Next Thread
mrencyc
Newbie



US
Joined: Jul 7, 2023
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Problem with imported object normals

I'm having difficulty importing sets of books I created in Blender. In Blender, they look fine



but when I try to import them to Sweet Home 3D they look like this:



It seems like there's something weird going on with the normals, but they render correctly in every other program and as far as I can tell they're correct in Blender. When I turn on backface culling in Blender every face still renders correctly.

I uploaded the .obj file here if anyone would like to take a look and see what I'm doing wrong.
[Jul 7, 2023, 4:33:06 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

Your zip file is missing/invalid so I can't take a look at it.
[Jul 8, 2023, 7:45:06 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
mrencyc
Newbie



US
Joined: Jul 7, 2023
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

Thanks, the link should work now.
[Jul 8, 2023, 8:23:40 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

Looking from the right at the books they are fine, from the left they are missing textured faces. Looks to me like you missed something in Blender, i.e. the books left side faces.
[Jul 8, 2023, 8:32:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
sjb007
Advanced Member




Joined: May 18, 2021
Post Count: 219
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

Looking quickly in Blender one thing I notice is that the facing sides of each pair of books are at the exact same y coordinate. This is probably the source of the weird rendering in SH3D. SH3D is using OpenGL, and overdrawing of exactly aligned faces can can cause weird artefacting in SH3D. Try separating them by a tiny amount.
[Jul 9, 2023, 1:20:13 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

And check that all faces are oriented outward. You might have a few faces that are facing in the wrong direction.
Wouldn't be the first time that happened with models created in Blender smile
[Jul 9, 2023, 8:29:08 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
mrencyc
Newbie



US
Joined: Jul 7, 2023
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

I had a weird thought and tried changing the .png file to .jpg and that appears to have fixed the problem. I've also had issues importing PNGs as textures so I think the issue is a bug in PNG support in Sweet Home 3D.
[Jul 9, 2023, 5:12:43 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

If the problem is solved by converting the PNG to JPG it's probably that tranparency in the PNG caused it, not a bug in Sweethome3D. I have never had problems with PNG's in Sweethome3D which of course respects the transparency in PNG's. Very useful to add an overlay text PNG with a transparent background for signs.
[Jul 9, 2023, 5:54:41 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Greymagic27
Newbie




Joined: Jan 28, 2023
Post Count: 8
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

I've had this issue as well. If it's just because of transparency when using .png then at least that's an easy fix. I can just rebake my textures into jpg.

Not my thread I know but helpful nonetheless, thanks OP!
[Jul 15, 2023, 6:58:18 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Daniels118
Advanced Member
Member's Avatar

Italy
Joined: Nov 17, 2021
Post Count: 407
Status: Offline
Reply to this Post  Reply with Quote 
Re: Problem with imported object normals

The problem is caused by the way raster 3D graphic handles transparent objects. Although your object is not transparent, it is treated as such because the texture has some transparent pixels. You can still use the PNG format as long you fill the whole image with fully opaque pixels (i.e. try to fill the transparent area with white).
The alternative is to divide the object in multiple shapes so that the rasterizer can draw them in the proper order.

For those interested I recommend these 3 lectures (must be read all in this order):
1) https://www.geeksforgeeks.org/z-buffer-depth-buffer-method/
the point 9 leaves with an open question, which is solved by this:
2) https://computergraphics.stackexchange.com/a/7630
and so this:
3) https://en.wikipedia.org/wiki/Painter%27s_algorithm
when you'll read the "Limitations" paragraph you'll understand the reason.
[Jul 16, 2023, 7:49:41 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved