Author Topic: transparent plastic bottle material  (Read 27346 times)

2016-07-03, 17:15:48

alexgabriel

  • Active Users
  • **
  • Posts: 11
    • View Profile
Hello all!

This is my first post to the Corona forum, I need a little help with a basic scene.

I am a complete beginner to Corona Renderer, so any advice is appreciated. I must mention I read the Index before writing this post, but I couldn't really piece together what I needed.

I am trying to render a believable transparent plastic material for a mineral water bottle, but I have yet to figure out a good method.  I tried using a couple from the Corona Materials Library site: Translucent Plastic ( by zzubnik ) and Transparent Plastic G ( by Douglas Cav. ), with similar bogus results.

I'm also not very sure about the water material either.

The scene setup is very basic, just a couple of corona lights, I also added a corona sun to the scene, just because it seemed that the light setup wasn't strong enough.

I use 3ds Max for building the scene, and I can upload it, should anybody want to take a better look at it. Of course, I can provide more info on the Corona material settings that I used in max, if it helps.

I only want it to look as similar as possible to a clear plastic mineral bottle, nothing more.

I've attached a shot of how it looks right now, any comments are welcome!

Thank you,
Alex
« Last Edit: 2016-07-04, 15:40:41 by alexgabriel »

2016-07-04, 15:27:05
Reply #1

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5460
    • View Profile
Most likely lots of different set ups for this, here's one I used - though this was for a standalone object against a black background, to be used in an animation (spinning on the spot, to be displayed in a hologram-style display), so the settings may not be so useful for embedding within an actual scene as things here had to be bright and bold - should give a starting point though.

Things to note

- It needs something to refract, for the refraction of the water to show up. You could add a Refraction Environment into the material for example - in this instance, I had an HDR image in the 3ds Max environment, and used Background Override to show a black background. With nothing to refract, it will lose the look. It also needs something to reflect too, but you seem to have that already.

- I've left Diffuse on in these examples, which gives a slightly "milky" look (and adds the blue colour to the bottle which was relevant given that the bottle was based on a particular brand). Removing that will give a much more clear, transparent look.

- Reflections here may be a bit over-bright, but they suited the purpose! If embedding it in a scene rather than floating on its own, may have adjusted that.

- The water isn't terribly obvious inside the bottle here (other than adding the refraction) but that was ok, as the bottle was tipped and for speed in the project I didn't want to get into modifying the model to make the top of the water surface angled as it would be with a tipped bottle ;)

- It was a purchased model, the bottle is not very thick at all. I didn't do anything with Absorption and Scattering for bottle or water.

- Bottle and water should be two different models (as they are here)

Hope something here sparks some ideas!

PS - the renders here are just quick grabs from the Interactive Renderer, didn't re-render properly for the sake of grabbing these images, which is why they are still noisy :)
« Last Edit: 2016-07-04, 15:30:49 by TomG »
Tom Grimes | chaos-corona.com
Product Manager | contact us

2016-07-04, 18:15:59
Reply #2

alexgabriel

  • Active Users
  • **
  • Posts: 11
    • View Profile
Hi TomG, thank you for such an elaborate reply!

I tried to apply the things you mentioned, however it still doesn't come close to the example you uploaded. The look you achieved for your render is pretty close to what I want, it actually looks like a plastic water bottle.

Practically, I added an HDR map into the background environment tab in Max. Next, I made a water and bottle material with the options from your shot. The result with these options can be seen in "bottle_1" I didn't touch the absorption or scattering either.
Afterwards, I tinkered with the refraction/reflection options inside the materials. I added the environment map as an instance into the refraction slot, reflection slot, into both materials. I tried every combination, the result was similar and unconvincing. ("bottle_2")
The reflections you mentioned I was able to use in my render are possibly triggered by the materials I downloaded from the Corona Material Library, for these new renders I didn't use those.

I'm aware that the problem here is related to how the reflection and refraction are employed in the respective materials but I can't seem to figure out what else to do.
I must also mention that the objects are of course separate into a water mesh and a bottle mesh. The bottle doesn't have thickness, nor is it double sided or something.

There's no problem if the reflections are over the top, I just want to achieve the specific look somehow. The guy that asked me to render this also provided some images for reference, like the "example" shot I uploaded.

The background or lighting is not that important as long as I can produce that plastic bottle look.

Sorry for the noisiness of the images, I just make quick renders so you can check out the reflections/refraction and look.

2016-07-04, 19:02:30
Reply #3

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi. I think this is your problem:
"The bottle doesn't have thickness, nor is it double sided or something."

1 - Try to make sphere and ad a glass material with refraction IOR 1,5 with "Thin" option unchecked
Render it.
2 - Now add a shell modifier to the sphere, and set it to 1mm, and render again. Do you see the difference?
3 - Now remove/deactivate the shell modifier and activate the "Thin" option in the material, and render. Do you see the difference?

The most realistic look will be with a bottle with some thickness + a refractive non-"thin" material (1)
The second most realistic will be option 3, and the worst option 2.

Using option 1 for the bottle the water should be modeled with a small overlap (the water being slightly bigger than the hole), and the water material shall be refractive. IIRC water IOR is around 1,33 (please check this).

Hope it helps

2016-07-04, 20:05:34
Reply #4

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5460
    • View Profile
The advantage I had in my scene is no ground and wall behind the bottle, so the refraction was easy to do! With those needed I think there are two options

1. Set up the "studio" so that the refracted rays hit a dark background of some sort. Could be tricky, though realistic.

2. Cheat some using the Rayswitcher material, which I tried here.

- I created two planes (well, boxes, I was lazy and just cloned the ground plane) on either side of the bottle. In the Direct, I placed a Corona Material that was completely transparent, so the objects don't show up at all when viewed from the camera. In the Refract, I placed a dark blue material. This shows up in the refraction on the bottle. This I found easier than trying to adjust the background objects to ensure the ray hit something other than the ground and walls. These are highlighted in the screengrab

- I did a similar thing with a plane. Used rayswitcher to make it invisible directly, but for reflection I painted on a radial glow texture I made in Photoshop, with self illumination. I dropped in the invisible material to the GI too, so it didn't add lighting to the scene. Kind of to emulate reflecting a softbox somewhere in the studio.

- I changed my reflection environment to something more complex. The main bright reflections are the two Corona lights, rectangular.

- I upped the refraction IOR for the water to 1.5 or so

Of course, setting up the studio "properly" is also an option, so that genuine dark cards, softboxes etc are reflected and refracted, but this can be easier to set up quickly as then you can move the dark cards and softbox simulation around wherever you like to get a good result without worrying if they are in camera or not :) Again not a perfect final image, but may give you some ideas.



Tom Grimes | chaos-corona.com
Product Manager | contact us

2016-07-04, 20:16:23
Reply #5

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5460
    • View Profile
Oops misnamed the materials for the dark cards, posting that again here :)

Also the bottle with and without those invisible objects, played with the tone mapping some too.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2016-07-05, 01:32:16
Reply #6

alexgabriel

  • Active Users
  • **
  • Posts: 11
    • View Profile
Hello again, thank you, TomG and PROH, for the replies!

I've been at it for a while, trying to emulate what you told me regarding the "simulated" studio look.
Right now I think it actually looks worse and further from reality than before. TomG, the way you render it is exactly what I'm looking for, however, I can't seem to work out what I'm doing wrong, although I followed in our footsteps exactly. It might be the fact that I'm lacking the experience with Corona, I might be thick or something and missing out the obvious, so I apologize if it's taking so long for me to figure everything out.

After following your example with the Rayswitcher materials, you can see how it looks in my uploaded shot, "result_1" ( please don't mind the background )
I understand what you're saying about setting up those boxes for the refraction, also, I used the three lights I had in the scene for reflection, however I'm not sure about the softbox bit but I did it anyways.

You can see the two boxes refracting, there are the usual reflections, however, everything looks "wrong"

I'm kinda lost now, this is why I want to ask, would you be willing to share the scene you built from your last post?  So I can import my own bottle in it and try to experiment a little with it. I use Max 2016 - Corona 1.4. I will still try and work on the scene regardless.

Secondly, PROH, it makes perfect sense what you're telling me regarding the various looks by changing thickness, I'll definitely apply what you're telling me, once I obtain a more believable look.

Thanks!

2016-07-05, 14:57:37
Reply #7

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5460
    • View Profile
Sure - had to take the bottle model out, since it was purchased and I can't share, so replaced it with spheres.

Also, no textures included so you'll need to use your own HDRI - in this new image, I used the free Newport Loft from HDRLabs siBL Archive collection, but though free I can't re-distribute it, link is here http://www.hdrlabs.com/sibl/archive.html. Probably could find a more suitable image anyway, something more like a studio rather than a room, but all depends on how it looks in the reflections so feel free to experiment!

The texture I used as the softbox type glow is attached though it was made in 2 seconds and you could do a better job :) A rectangular style glow would be more realistic.

Saved it from Max 2017, as a 2014 compatible file (the earliest 2017 would offer). Corona is 1.4.

Hope it helps!



Tom Grimes | chaos-corona.com
Product Manager | contact us

2016-07-05, 23:31:57
Reply #8

alexgabriel

  • Active Users
  • **
  • Posts: 11
    • View Profile
Hello again,
Thanks a lot for the scene! I tried to put it to good use today, I'm still getting weird results, but I feel like I'm closing in on something.

I noticed that there were some differences between my render settings on yours I'll list them below( mine are the latter), also maybe you can shed some more light on what they do more specifically:
- pass limit: 10 vs pass limit:0 ( is there an optimum pass number that I should take into account? )
- render selected: disabled vs render selected: Object GBuffer ID ( is this something that actually influences the look or the rendering, or just regions of the render )
- GI vs AA balance 32 vs 16
- Max ray depth 50 vs 25
- Image filter Width [px] 1.5 vs 2.0

Also, when I opened the scene you sent me, I was notified that there where two HDR images missing. One was placed into the Max environment map, which makes sense, but I can't figure out what the second one is for (conference_room mod.exr), so I can replace it with some properly similar image.

As you can see from my upload, now it's got a more convincing look, however, from what I can guess, I probably need to move the dark cards around to make them refract better.
I think it might be the shape of this naive bottle that is difficult to work with in order to produce a proper result.

I'll try to experiment more with light and object positioning, and thanks again!


2016-07-06, 00:45:52
Reply #9

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5460
    • View Profile
Aha that is looking better, glad it has helped!

- Render passes tells Corona when to stop, when you use the Render button (not when you use the Interactive Renderer). With a value of 0, Corona will keep adding more passes until you manually hit stop (so you can watch it until the noise cleans up to a point you are happy with), while I had the scene set to stop after 10 passes as that seemed good enough. I did enable Denoising as well.

- Render selected, this generally should be Disabled, so that everything in the scene renders. As the tooltip notes, with it enabled, it will only render the selected objects (but keep indirect lighting from other objects affecting whatever is rendered). Usually used to "fix" a render by re-rendering one (or a few) objects, without re-rendering the whole scene.

- GI vs AA balance, must have tweaked that back when I did the original scene. If I remember right my thinking was that the AA (anti aliasing) wasn't too critical in this scene, but I wanted any noise in the lighting to clean up faster. Wouldn't be a major player in differences in your render and mine.

- Max Ray Depth, I did raise that as part of messing around with the scene - it controls how many times a ray can bounce, I was curious in terms of the reflection and refraction going on as to whether it made any visible difference. As I recall, it made no difference at all raising it to 50, I just forgot to lower it again! The default of 25 should be fine, and render slightly faster.

- Image Filter, don't think I changed that, or if I did I don't recall. Wouldn't really affect the look of the material, just the overall image sharpness, with a lower value being slightly sharper.

- The missing HDRI comes from a stray unused bitmap in the scene. I had several HDRIs originally for the bottle on the black background (no ground or wall behind it), but before sending the scene over just narrowed it down to use one since there was a ground and wall. The other image Max remembers, but isn't actually being used anyplace so the message can be safely ignored.

Objects with refraction and reflection are hard to render against plain backgrounds, as most of their shape is defined to the eye by the reflection and refraction, and with nothing to reflect / refract, it is hard to make it look good. In photographic studio set ups, white cards, lights (positioned as much for their reflection as for their lighting angle), umbrellas, softboxes, black cards, etc, are used to overcome this. This does mean the shape of the object will play a large part in where to place these elements, or their 'fakes' in this case! Usually you want them placed so that they show up in the edges, for instance I like the right side of the bottle in your image, but the top left side has a bit too much of the card showing, so moving the card causing that would make its refraction nice and "thin" like on the other side of the bottle.

If you are allowed to have something other than a plain background (other objects, etc) then that might make life easier, but depends on what the client wants for the image!
Tom Grimes | chaos-corona.com
Product Manager | contact us

2016-07-06, 02:10:26
Reply #10

alexgabriel

  • Active Users
  • **
  • Posts: 11
    • View Profile
Yes, it does, and I won't stop now, with a little patience I'll produce the desired look.

Firstly, I want to mention that I took note of all your comments regarding the renderer settings, I appreciate that, now I've got a better grasp of them.

At first, I thought I wouldn't fuss too much with this scene, as it was only one simple object to produce. However, from what you're telling me, it's a little tricky to get proper results when it comes to rendering objects of this sort, with reflection, refraction and translucency.

Regarding the prerequisites of my client, it's that situation where the client doesn't have much vision over the final product, so I guess anything goes, as long as I make it look believable. There's no actual "must" for the background or any other scene object, except the bottle elements themselves, so if you have any advice on setting the scene better in any other way, fire away, I'll be happy to try it!( however, I'm not sure how the bottle would look with no background to refract through it, maybe too black? )

You're right, the right side of the bottle is actually getting there, it's only the left side where the magic isn't happening yet, I'll play around with the cards and upload another shot, maybe with better placed refraction.

Also, I think that this bottle, having such a specific look ( kangaroos all over ), should have these details stand out somehow. I was pondering on how to do that, as there is no actual fine shadow in the scene, like an ambient occlusion pass, going over the plastic of the bottle. That would make the details stand out, I added an AO pass ( a Corona AO material added to the CTexmap Render Element texture slot - at least this is how I saw it being done on Youtube ) to the render elements but it looks weird in my opinion (AO_pass), I mean, it's not that usual subtle result you get with render to texture in max or rendering an ao in xNormal or TopoGun. In other words, it looks like I'm rendering the object with some gray material on top and nothing more. To contrast this, I'll also upload an ao pass that I produced with mental ray (mr_AO)It looks very thick and noisy. Do you happen to have any ideas on how to achieve such details?

Thanks again for your patience!

2016-07-06, 10:24:20
Reply #11

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8832
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Did you add thickness to your bottle model yet? Try as you might, you can never get convincing results without thickness and proper refraction. Besides, when your model is double sided, you can relax inner mesh a little bit and with the help of absorbtion and refraction, small differences in thickness should yield much more distinctive shape of that kangaroo on bottle without need of AO. Although you still may want to use AO in your material to simulate accumulated dirt.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-07-06, 16:14:33
Reply #12

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5460
    • View Profile
Was wondering about the thickness too, it does look like it doesn't have any and that will make a difference.

On the AO, lots of settings can be used to adjust the AO. A lower Max Distance will stop the rays looking so far for occluding surfaces, a higher Ray Directionality will keep the searching rays more focused rather than spread (and again "tighten" the results), and Colour Spread could help too. This video here goes through the settings, is using it as a dirt map but the principles of controlling the results of the AO are the same -

That said, AO might not be the solution here - generally it is used to highlight the shape of geometry by creating fake shadows to make things pop, but, a transparent / reflective material doesn't have any diffuse so doesn't catch shadows like that. Most every effect that lets us see the shape comes from reflection and refraction.

If you are free to make the scene any way you like, you could add a texture to the ground surface, and remove the back wall and let an HDRI image show there (like the object is placed on a kitchen countertop for example), could add some other objects on the counter top, even just more than one bottle. All of this would give things for the bottle to reflect and refract without having to fake anything. Attaching an image of the previous sphere (distorted it with an FFD modifier just so it has some shape), with the fake black cards and softbox turned off, and the Corona lights made less intense - with the background visible, their shape can be clearly made out without tricks!

You could use a very out of focus background for your HDRI to keep attention on the bottle.

(and yes, I was lazy and didn't fix the water in the rotated sphere - welcome to no gravity!)

PS - I did lower the reflection Glossiness to .5 on the plastic material here, so it has softer reflections than the water, felt it looked better with the background in full use.
« Last Edit: 2016-07-06, 16:18:30 by TomG »
Tom Grimes | chaos-corona.com
Product Manager | contact us

2016-07-07, 00:51:25
Reply #13

alexgabriel

  • Active Users
  • **
  • Posts: 11
    • View Profile
Ok, thanks a bunch again for the replies, it really helped!

Now, to get this out of the way, the bottle had a very very thin shell, it wasn't actually noticeable. After making it a tad thicker, the refraction results are actually better, it's more of a subtle result, but it affects the entire surface of the mesh. I also relaxed the mesh just a little, because it tended to warp the details in and out, making them look nasty.

Regarding the actual scene setup, the guy that asked me to do this only needs the bottle itself, presented as a .png file, so he can use it wherever he needs. So, there's actually no need for anything else in the scene I guess, except strictly the elements to make it look convincing.

TomG, I took your advice again, and played around with all the scene elements. The conclusion is that I only need the bottle elements itself, the lights and the max hdr environment to produce a convincing look. Who would have guessed, at first I thought I would need some elaborate scene for this, but it's definitely not the case.

As you can see in shot "hdr_1", it looks a lot better now, it's not perfect yet, however it's come along way from how it looked in the beginning.

For this, I only used an hdr environment map and the two lights in the scene, you can see them reflecting in the bottle, to give it some highlight. I used a free hdr map from the hdrlabs site, which I blurred in photoshop using Field Blur.

However, right now I'm stuck again. I was playing around with the settings and it came to me that I try some other materials on the bottle, which I had in another scene. The problem appeared after I messed around with the scenes and materials. The hdr environment suddenly went crazy. Practically, when I look at the hdr map in the render window ( I added the hdr map into the Direct visibility override as an instance to be able to see the background ), it just shows a flat colour and the look of the bottle has completely changed from the nice result I had earlier. You can see what I mean in the other shot "hdr_trolling_me", it's different altogether.

It was looking so nice, and now it's messed up, any ideas how to fix this issue?

PS, I'll leave the AO part for when I get this hdr issue out of the way.

Thanks!

2016-07-07, 01:09:30
Reply #14

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi. I think that your HDRI spherical map somehow has changed the setting to "Screen" instead of "Spherical" or to "Material" instead of "Environment". It could also be the camera/perspective that has switched to "user" (orthographic).

The bottle still looks very thin, but I can't say why without having your scene. But I would suggest using the real "thickness" of the bottle, and NOT using the "Thin" option in the material (if it is in fact turned on).

Another thing: Why are you instancing the environment map to the reflection map? You need both the light, reflections and refractions from this map, so why not simply put another background (bitmap/color/gradient) into the "Direct Visibily" slot?

Hope it helps
« Last Edit: 2016-07-07, 02:22:23 by PROH »