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: 14
Posts: 14   Pages: 2   [ 1 2 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 2075 times and has 13 replies Next Thread
Walter125
Member




Joined: Sep 11, 2023
Post Count: 25
Status: Offline
Reply to this Post  Reply with Quote 
Light refraction and mirror effect rendering.

Hi,

I have downloaded a greenhouse 3D model on internet.

But I'm unable to render it correctly when I make a photo at the higher quality.

There are 2 problems:

- The surfaces have a too much pronounced mirror effect.

- The light changes direction when it passes throught the curved surfaces. So the objects in the greenhouse are displayed deformed.

Here is the .mtl definition of the transparent surface of the greenhouse:

newmtl Translucent_Glass_Blue.001
Ns 0.999999
Ka 1.000000 1.000000 1.000000
Kd 0.392157 0.584314 0.929412
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 0.75
illum 1


I tried modifying it with various values, but it didn't solved my problems.

Does someone know:

- How to reduce the mirror effect of a surface ?

- How to reduce the deformation of objects inside or behind a curved transparent surface ?
[Oct 2, 2023, 12:15: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 
Keet
Advanced Member
Member's Avatar

Netherlands
Joined: Apr 8, 2022
Post Count: 789
Status: Offline
Reply to this Post  Reply with Quote 
Re: Light refraction and mirror effect rendering.

Here are the specifications for MTL files: https://www.loc.gov/preservation/digital/formats/fdd/fdd000508.shtml and a more extended version: http://www.paulbourke.net/dataformats/mtl/

I use this for normal glass:
newmtl Glass
illum 1
Ka 1.0 1.0 1.0
Kd 1.0 1.0 1.0
Ks 0.0 0.0 0.0
Ns 1.0
Ni 1.45
d 0.45

Ks states the shiny/reflection of the material. Usually between 0 and 1, values outside that range will effect reflectivity.
Ni is the refraction factor, i.e. the deformation when looking through glass.
d is the opacity with a value between 0 and 1: 0.0 = fully transparent, 1.0 = fully opaque.

• Your d value is pretty high for glass.
• It's normal that light breaks (changes direction) through glass. Adjust your Ni value if it seems too much. Lowering the d value might also help in lowering the refraction. Greenhouses usually use cheaper glass which will refract more than window glass.
• In real life curved glass will distort (refract) a little more than flat glass depending on the quality of the glass, adjust the Ni factor if it's too much.
• You will have to experiment with the different values to get what you want. What you see in the 3D view is not exactly the same as when you render a photo, photo rendering is much more sensitive to the mtl values.
[Oct 2, 2023, 1:32:13 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Walter125
Member




Joined: Sep 11, 2023
Post Count: 25
Status: Offline
Reply to this Post  Reply with Quote 
Re: Light refraction and mirror effect rendering.

Thanks for the informations.

My d value is high because it is a plastic cover.

I started to design myself the greenhouse with curved cover, using only SweetHome3D and a text editor, exporting some objects, like a curved wall, to .obj, and importing it as a standard object.

The 3D model I have designed is correctly rendered with a Ni value of 1.0.

So it seems the problem comes from the 3D model I have downloaded. It doesn't render correctly even after a lot of experiments in the .mtl file.
[Oct 2, 2023, 5:21:13 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: Light refraction and mirror effect rendering.

Have you tried importing the downloaded model, exporting it from Sweet Home 3D, and then importing it again? Optionally after adjusting the values in the mtl file.
The models should be the same either way, but I have found out with other models that this is often not the case, especially concerning the materials.

Of course creating your own models is absolutely the best, I custom create ALL my models with just a few from the furniture libraries from the Sweet Home 3D site until I can replace those too.
[Oct 2, 2023, 5:54:17 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9182
Status: Offline
Reply to this Post  Reply with Quote 
Re: Light refraction and mirror effect rendering.

You could also try how the same transparency parameters are rendered by changing the renderer, either SunFlow or YafaRay.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[Oct 2, 2023, 6:04:25 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Walter125
Member




Joined: Sep 11, 2023
Post Count: 25
Status: Offline
Reply to this Post  Reply with Quote 
Re: Light refraction and mirror effect rendering.

@Keet

I tried your suggestion, but there are still the same problems.

@Puybaret

I tried SunFlow, and there are also the same problems.


I openned the original DAE/Collada file with Blender, and it showed some mechanical objects only viewable with blender. There was also some misplaced points for the greenhouse object.

I think I have finished my own model of greenhouse, it is a very basic model, and seems to render correctly.

I made it modulable, one duplicable element for the middle, and one element for the begining and the end of the greenhouse.

So with these two elements, I can make a greenhouse of the lenght I want.

However the model isn't as well worked than the one I have downloaded, there are no doors in the plastic cover, at the beginning and the end on the greenhouse.
[Oct 3, 2023, 8:37:46 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: Light refraction and mirror effect rendering.

I created a commercial greenhouse some time ago maybe you can use it to create your own. It's still a work in progress but you're free to use and adapt it for your own use.

You can't see it in the images but you can open all doors and multiple rows of windows in the shell.

https://www.mediafire.com/view/bap769enr8kmeqa/greenhouse.png/file
https://www.mediafire.com/view/d9on1j3lfc047ox/greenhouse-objects.png/file
https://www.mediafire.com/view/y1rcp43ydgajwv...e-with-furniture.png/file

Zip with all objects
Zip with the project
----------------------------------------
[Edit 1 times, last edit by Keet at Oct 3, 2023, 9:36:17 AM]
[Oct 3, 2023, 9:31:59 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Walter125
Member




Joined: Sep 11, 2023
Post Count: 25
Status: Offline
Reply to this Post  Reply with Quote 
Re: Light refraction and mirror effect rendering.

@Keet

Thanks for the files, I will have a look a it.

My model still have some problems, maybe related to normals. Because I'm using the same .mtl definition for the curved cover, and for the flat cover at the beginning and the end of the greenhouse.

The curved cover is rendered correctly. I have created it from a curved wall in SweetHome3D, exported to .obj.



But the flat cover has been created from a room that fit the curved wall, also exporting the room to .obj.

This flat cover doesn't render correctly, the light change direction when it goes into it.

I tried some basic normals changes in the .obj file, and the light took other directions, but it didn't solve the problem.



If someone have the time to test and help me, here is the .mtl file of the flat cover:

newmtl cover
illum 1
Ka 1.000000 1.000000 1.000000
Kd 0.392157 0.584314 0.929412
Ks 0.0 0.0 0.0
Ns 1.0
Ni 1
d 0.75


And .obj file, that needs to be rotated to vertical, when importing it:
mtllib greenhouse-end.mtl
g room_1_1
usemtl cover
v 143.92583 0.1 146.97046
v 122.97447 0.1 149.85016
v 102.61039 0.1 155.55591
v 83.21291 0.1 163.98143
v 65.14338 0.1 174.96976
v 48.73839 0.1 188.31621
v 34.30354 0.1 203.77216
v 22.10772 0.1 221.0497
v 12.378101 0.1 239.82701
v 5.2959633 0.1 259.75424
v 0.99321324 0.1 280.46024
v -0.45 0.1 301.55927
v -0.45 0.1 371.55927
v 309.55 0.1 371.55923
v 309.45 0.1 301.55908
v 308.00677 0.1 280.4602
v 303.70404 0.1 259.75424
v 296.6219 0.1 239.82697
v 286.89227 0.1 221.04968
v 274.69644 0.1 203.77214
v 260.2616 0.1 188.3162
v 243.85661 0.1 174.96974
v 225.78708 0.1 163.98141
v 206.3896 0.1 155.55591
v 186.0255 0.1 149.85016
v 165.07416 0.1 146.97046
vn 0.0 1.0 0.0
f 25//1 26//1 1//1
f 25//1 1//1 2//1
f 25//1 2//1 3//1
f 25//1 3//1 4//1
f 25//1 4//1 5//1
f 25//1 5//1 6//1
f 25//1 6//1 7//1
f 25//1 7//1 8//1
f 25//1 8//1 9//1
f 25//1 9//1 10//1
f 25//1 10//1 11//1
f 25//1 11//1 12//1
f 25//1 12//1 13//1
f 25//1 13//1 14//1
f 25//1 14//1 15//1
f 25//1 15//1 16//1
f 25//1 16//1 17//1
f 25//1 17//1 18//1
f 25//1 18//1 19//1
f 25//1 19//1 20//1
f 25//1 20//1 21//1
f 25//1 21//1 22//1
f 25//1 22//1 23//1
f 25//1 23//1 24//1
g room_1_2
usemtl cover
v 143.92583 0.0 146.97046
v 122.97447 0.0 149.85016
v 102.61039 0.0 155.55591
v 83.21291 0.0 163.98143
v 65.14338 0.0 174.96976
v 48.73839 0.0 188.31621
v 34.30354 0.0 203.77216
v 22.10772 0.0 221.0497
v 12.378101 0.0 239.82701
v 5.2959633 0.0 259.75424
v 0.99321324 0.0 280.46024
v -0.45 0.0 301.55927
v -0.45 0.0 371.55927
v 309.55 0.0 371.55923
v 309.45 0.0 301.55908
v 308.00677 0.0 280.4602
v 303.70404 0.0 259.75424
v 296.6219 0.0 239.82697
v 286.89227 0.0 221.04968
v 274.69644 0.0 203.77214
v 260.2616 0.0 188.3162
v 243.85661 0.0 174.96974
v 225.78708 0.0 163.98141
v 206.3896 0.0 155.55591
v 186.0255 0.0 149.85016
v 165.07416 0.0 146.97046
vn 0.0 1.0 0.0
f 52//2 51//2 27//2
f 27//2 51//2 28//2
f 28//2 51//2 29//2
f 29//2 51//2 30//2
f 30//2 51//2 31//2
f 31//2 51//2 32//2
f 32//2 51//2 33//2
f 33//2 51//2 34//2
f 34//2 51//2 35//2
f 35//2 51//2 36//2
f 36//2 51//2 37//2
f 37//2 51//2 38//2
f 38//2 51//2 39//2
f 39//2 51//2 40//2
f 40//2 51//2 41//2
f 41//2 51//2 42//2
f 42//2 51//2 43//2
f 43//2 51//2 44//2
f 44//2 51//2 45//2
f 45//2 51//2 46//2
f 46//2 51//2 47//2
f 47//2 51//2 48//2
f 48//2 51//2 49//2
f 49//2 51//2 50//2

[Oct 3, 2023, 2:48:12 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: Light refraction and mirror effect rendering.

If possible don't use a room for the flat cover but try it with a resized box or wall.
You can see in the .obj file that a room is constructed in a completely different way. If you apply a normal texture you will also see that the sides aren't textured correctly, probably because it's assumed that you don't see the sides of a floor.

A box or a wall is better suited to create glass or semi-transparent plastic. In your case you might try using a wall because you also use a wall for the curved plastic. The same mtl should give the same result.
[Oct 3, 2023, 3:28:59 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Walter125
Member




Joined: Sep 11, 2023
Post Count: 25
Status: Offline
Reply to this Post  Reply with Quote 
Re: Light refraction and mirror effect rendering.

Thanks for advices.

I have finally got it working.

It seems the problem was that my flat cover had only 2 faces, the front and the back.

So I have created the same room at a higher level, because a higher level room have a configurable thickness. I set the thickness to 0.1 cm. And exported the room to an .obj file.

It worked. The greenhouse seems to be rendered correctly.

But I divided it into 4 parts, in order I can build greenhouses of different lenght: 2 parts for the metal skeleton, and 2 parts for the plastic cover.
[Oct 3, 2023, 5:56:42 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 14   Pages: 2   [ 1 2 | Next Page ]
[ 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