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: 9
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 540 times and has 8 replies Next Thread
scjo
Member
Member's Avatar

Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status: Offline
Reply to this Post  Reply with Quote 
(Semi)transparent Mirrors

With the magic group name prefix sweethome3d_window_mirror in the *.obj, the mirror's colour cast can still be controlled by the Kd floats in the *.mtl.

Expectation: because d is a float, d controls the opacity proportionally.

Observation: d = 0 makes the mirror invisible, but any d > 0, no matter how small, makes fully opaque.

When instead of d, a texture with alpha channel is applied, the latter gets even completely ignored. The mirror is opaque all over, even where alpha = 0.0

With transmission instead of reflection, d resp. texture alpha have the expected effect. Because colour works accordingly with reflection, too, I assume the observed transparency behaviour is not intended.

Have I missed something? Should I file a bug report?
----------------------------------------
Cheers - Joe //
[Oct 30, 2024, 3:42:45 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: 1290
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

It has nothing to do with the d value being a float. Understand that the mtl file holds the definitions of materials. Nothing more, nothing less. It is up to the applications that use the file if and how it uses the information.
For example Sweet Home 3D only uses the basic map_Kd for textures (both use and write). Other applications like Blender can and will use additional color and texture definitions that might be available in the mtl file. The same goes for the d value (transparency). By default Sweet Home 3D doesn't write the d value when exporting but when it's there it will use it for the 3D view. If you imported an object with a d value it will retain that value when exporting again.
Sweet Home 3D does write a 'd 0.5' value for materials on groups with the prefix 'sweethome3d_window_pane_'. It also writes the d value when transparency is set in the 3D view preferences before export. In the Generate 3D shape tool you can set a transparency that is also exported with the d value.

GaudiGalopin3324 did a great experiment with transparency: http://www.sweethome3d.com/support/forum/viewthread_thread,13493
Reproduce that experiment but now with the added sweethome3d_window_mirror_ prefix. It will show you exactly how Sweet Home 3D handles the different options, both in the 3D view and photo rendering. Show us the results!
----------------------------------------
Dodecagon.nl
950+ 3D models, manuals, and projects
[Oct 30, 2024, 8:05: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 
scjo
Member
Member's Avatar

Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

The case studies of GaudiGalopin3324 are really very instructive and inspiring. They answer many of my practical questions. Great THX to him!

Because SH3D regards Kd with reflection as well as with transmission, regards the d with transmission it as insinuated by the *.mtl spec, and even with reflection it regards the sign of d, I thought, it might regard the absolute of d with reflection as well.

Thanks for clarifying, though. Of course, the .*mtl spec defines a data structure, not software behavior. However I thought, reflection is mathematically not too different from transmission/refraction. Therefore I was surprised.

Still wondering if this is worth a software request.

Meanwhile I am considering a somewhat laborious workaround by means of compositing:
    0. Preparation: Export the object in question to have an *.obj/*.mtl file pair for this procedure.
    1. Reflected fraction: Render the scene with mirroring enabled
    2. Transmitted fraction: Make the mirror a glass pane, i.e. in the *.obj, remove or mask the sweethome3d_window_mirror prefix. If it has a color tint or texture, keep that effective! Render again.
    3. Compositing: overlay the output of 1 (reflection) with that of 2 (transmission), weights according to transmissivity of mirror. E.g. if the mirror is 30% transparent, make 1. the background, and 2. the top layer with a density of 30%.
    Suitable compositors: GUI - Gimp; CLI/scripting - Image Magick.
This is a first idea. Much headroom for optimization or enhancement. I have not even tried it myself yet. Comments, objections, suggestions highly appreciated.
----------------------------------------
Cheers - Joe //
[Oct 30, 2024, 2:42:58 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
GaudiGalopin3324
Advanced Member
Member's Avatar

Russia
Joined: Aug 13, 2022
Post Count: 528
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

the mirrored surface does not want to be translucent in any way. It's either there or it's not, I can't get any options in the middle. The MTL file is completely blocked. Translucent textures don't work.
I made a variant with a double outer shell. First, the mirror ball is 100 cm, outside the ball is 100.4 cm in diameter. It has a special translucent texture with a gray gradient from opaque to transparent. I placed it on the sphere at a scale of 1400%, rotated it by 225 degrees. On one side of the ball, the texture is opaque, and on the other side it is transparent, a mirror surface of the inner ball appears under it. Such an outer shell allows you to get body shadows on the ball (and on any other surface) and this "dusty" surface can be additionally highlighted. The mirror cannot be illuminated like that, and there will never be real glare from the sun on it, for example. And on such a surface, you can make an imitation of glare. For comparison, the first render is just a mirror ball, the second render has an outer shell with a translucent texture. I hope there is still a simple and easy way to control the mirror surface. There is this way somewhere.. But where...? confused




[Oct 30, 2024, 10:28:57 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
scjo
Member
Member's Avatar

Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

It works:


The mirror is 70% transparent. You may try different transparencies using the source images. With Image Magick installed, compositing is a simple command:
composite mirror-opaque.png -blend 70% mirror-off.png mirror-semi.png

In reality, the scene behind the mirror would be quite dim, and the transparency much lower, maybe 15%. That makes it harder to look through from the front and accommodates the observer behind to the little amount of passing light.

The mirror leans 1° away from us. Therefore the mirrored horizon is 2° below the one in direct view.
----------------------------------------
Cheers - Joe //
[Oct 30, 2024, 10:51:11 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
scjo
Member
Member's Avatar

Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

You were faster than me.

the mirrored surface does not want to be translucent in any way. It's either there or it's not, I can't get any options in the middle
I ended up with the same. That's why I render the reflected resp. transmitted light separately, and then compose the result.

I have only dealt with transparency. Translucency is a different story because it involves scattering. If only we can master that (I don't know how) with any non-mirroring material, probably compositing also fits this case.
----------------------------------------
Cheers - Joe //
[Oct 30, 2024, 11:00:48 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
GaudiGalopin3324
Advanced Member
Member's Avatar

Russia
Joined: Aug 13, 2022
Post Count: 528
Status: Offline
Reply to this Post  Reply with Quote 
applause Re: (Semi)transparent Mirrors

I've studied everything. A very interesting method!! But of course I would like to get the effect of a transparent mirror immediately in the render, without combining. But still bravo! I didn't figure it out before this separation of renderers. It seems to me that it is possible to use such a mix of renderings in the exterior of a house with mirrored windows, when there is internal lighting of the rooms (this will be visible to the viewer through the windows from the outside) and mirror reflections of the street in the shadow areas of the facade. I am very glad that you posted your result, thank you!
[Oct 31, 2024, 7:51: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: 1290
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

I also did a little research on this. In Blender you can get the semi-transparent mirror effect by combining a mirror and transparency shader. It appears that getting the correct result depends on the capabilities of the renderer. I suspect that both Sunflow and YafaRay can't do this, at least not when directed from Sweet Home 3D.
----------------------------------------
Dodecagon.nl
950+ 3D models, manuals, and projects
[Oct 31, 2024, 8:13:56 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
scjo
Member
Member's Avatar

Germany, Berlin
Joined: Sep 12, 2024
Post Count: 53
Status: Offline
Reply to this Post  Reply with Quote 
Re: (Semi)transparent Mirrors

My initial goal was modelling a perforated rough-shiny metal plate. So, I could't resist trying to control the transparency of mirrors not only gradually but also locally by a map, in order to get a perforated mirror. But that goes OT of this thread, so I posted it in the project thread.
----------------------------------------
Cheers - Joe //
[Nov 1, 2024, 1:34:26 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 2024 Space Mushrooms - All rights reserved