Thread

Transparent material bug

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Transparent material bug // Bugs

1  |  

Post by Changa // Apr 8, 2007, 8:29am

Changa
Total Posts: 187
pic
Hi.

I've told about this phenomenon few years ago with ts5. Experienced guys answered that is 'historical' bug since ts2 or 3 ?. Now I see that Caligari really decided to keep this bug forever. Try to reproduce it.

1. New scene

2. No lights (or do some if you are scared :) )

3. Background image on (any from library)

4. One cube with default meterial (or do 'reset all' in ME)

5. One glass (sample glass reflectance from library) smaller cube in front of the first one

6. One camera in front of smaller cube looking to both cubes

Now render it. You have 3 choices Virtualight, LightWorks and Vray, but result is only one - glass cube works like a window. You can see the background through the solid nontransparent cube!

Pls solve it in TS7.5 I work a lot with architectural visualization and effect is that through a glass window you can see not the interior of the building but a background behind! Of course it space. But not True.

Post by parva // Apr 9, 2007, 12:26am

parva
Total Posts: 822
pic
Can't say if it will be solved or not but you can use a plane with texture/constant material as background instead. This works as expected and you can link the plane to the camera so that it works as a fixed background.
Btw. the "problem" (not sure if it's a problem) isn't the transparency, it's the reflection (at least in the tests I had made). The background is a 360° surround which reflects also from other site which gived the illusion of "shining trough".

Post by Changa // Apr 9, 2007, 4:36am

Changa
Total Posts: 187
pic
Parva,

you are right. It is reflection. But wrong reflection. Look at these new pictures. I've change cube for reflective sphere(reflection 0.6, transmittion = 0, refraction = 1). But it does not reflect as a spere with LightWorks and Virtualight. Vray does correct rendering. Am I right? My suggestion is to correct reflection of a background in LW and VL, and not to reflect the part of the background that is behind our back at all. Because if you try to simulate the same situation with two planes with image texture one in front of camera and another behind, reflection will 'flip' image that is behind and you will see mirrored images. Here reflection gives the same image (not mirrored). If my explanation is not good I can model it.

Post by Changa // Apr 9, 2007, 7:25am

Changa
Total Posts: 187
pic
That's it!

First picture - image background and reflection of it's invisible (behind us) part in mirror. Second image - plane and reflection of the same plane (located behind us) in the mirror. Different. Aren't they?

So, as we can see here and in my previous post reflection of image background is out of normal optical rules. Is it bug or still not?

Post by parva // Apr 9, 2007, 10:06am

parva
Total Posts: 822
pic
not to reflect the part of the background that is behind our back at all.

Of course I agree.

Post by prodigy // Apr 9, 2007, 2:49pm

prodigy
Total Posts: 3029
pic
This is something interesting..


I had few glasses with glass shaders.. if you see are complete normals.. then i add a hdri image (just a JPG ) totally black with 2 white cubes to simulate 2 windows.. Just to get the Reflections..


5272


Well here is the problem..


Whey i add i unselect "show envoirament image" and "use only Envoir lights" to get the reflections but with a light (cos the hdri doesnt make any light)


happend this..


Is like the Black reflects Black, and not transparent.. Black doenst emmit light and doesnt reflects...


5273

Post by Changa // Apr 9, 2007, 10:44pm

Changa
Total Posts: 187
pic
Parva,

as i can see you are from Caligari team. But I do not know is your opinion the official answer from caligary or just your personal. Be honest, me and hopefully other TS users who find bugs or strange behaviour of Ts from time to time, want something like - 'OK, Changa we will investigate it and add this and this to the bug list for future improvement.' Beleve me we all want Ts be better and maybe even the best 3d soft in the world, thats why we try to help Caligari team and not only to point the index finger at all Caligari mistakes with laught. So we need your answers and sometimes even small thanks.

Post by TomG // Apr 11, 2007, 3:48am

TomG
Total Posts: 3397
This looks like it is related to simply using a background image. Some possible solutions are:


1. Use HDRI - here the HDRI image is wrapped around the scene and reflections look as you would expect


2. Use an environment sphere - again this wraps the image around the scene and gives the reflections you would expect.


3. Use and Environment Map shader that will simulate reflections from a 2D image


Most likely there are other possible solutions too :)


The issue arises as a background image is just that - a 2D, flat image that does not wrap around the scene. This is an issue with the render engines and the Background Image selection for background color, which was never intended to give a proper wrap-around environment for generating reflections and refraction, but instead only to make the background image show up behind objects in the scene.


To get reflections and refraction, avoid the Background Image and use the other solutions. Generally I would never use the Background Image option for these and other reasons (it doesn't blur properly with depth of field as the render engine has no idea how far away it is; you can't pan the camera at all as the image remains static; you can't zoom the camera in and out as the image remains static; you can't resize the window without distorting the image; and more). All these arise because the Background Image is only a quick fix to dropping something in there in the background - a slightly more involved solution like a plane with the image on it, an environment sphere, HDRI, etc, all give much better results that are more robust and are intended for the sort of use shown here.


HTH!

Tom



EDIT - PS Parva is on the beta testing team, so cannot give official Caligari answers, only personal experience :)

Post by prodigy // Apr 11, 2007, 5:02am

prodigy
Total Posts: 3029
pic
But the Black reflection yes, that is a bug. cos the Black is no light.. and the black color must no reflects on anything.. just not illuminate and that must not affect the transparency..

Post by pixelpantscher // Apr 11, 2007, 7:55am

pixelpantscher
Total Posts: 39
Hey Prodigy,


what happens if you set the backgroundcolor in the rendersettings to a different color then the standard grey? ie to white.

What I guess what might happen is: the HDRI-image you are using is black except the two "windows" the standard background color in the rendersettings is in an undefined distanze to your scene and not influenced by the lights, so it will not reflect at all. but if you keep a black paper behind a glas it is creating a mirrorlike effect and this shows the other side of your black HDRI - image. As far as I can see on your pictures the transparency is not influenced. You can see the reflections of your "windows" on the inside of the glas in center.


But anyway this is only what I guess :)

Post by pixelpantscher // Apr 11, 2007, 8:01am

pixelpantscher
Total Posts: 39
ok this wa not as clear as it should be:)


What I wanted to say is that the black color in the back of your glasses is like a black paper behind a window wich makes the glas behave like a mirror.

Post by Changa // Apr 11, 2007, 8:04am

Changa
Total Posts: 187
pic
Hi TomG,

thanks for official reply. Beleve me I use all these solutions too. An I know about disadvantages of backgroud image but... I beleive that each mechanism shoud work as it should work. Do you want a car which goes left if you turn the wheel right? From the manual I've found that background image just replaces parts of the scene not covered with 3d geometry. Actually it's involved in rays distribution and in this case should follow any rules. (optic or logic). Look at the pictures in my post № 3. Different rendering engines give different reflections. At least all these pictures should be same to follow logical rules. To follow optics rules reflection should be like reflection from the plane behind the back. Or.. just turn reflection from background image off. Swear I will shut up! :D I just don't like misunderstanding. (see my other thread http://forums1.caligari.com/truespace/showthread.php?t=2577)

Post by prodigy // Apr 11, 2007, 8:14am

prodigy
Total Posts: 3029
pic
ok this wa not as clear as it should be:)

What I wanted to say is that the black color in the back of your glasses is like a black paper behind a window wich makes the glas behave like a mirror.

Pixel, thanks, thats what happend.. the transparent glass became like a "mirror" yes..

The black must not be seeit or reflected on the glasses but yes the white "windows"... :rolleyes: better explained thanks! :D

Post by pixelpantscher // Apr 11, 2007, 8:37am

pixelpantscher
Total Posts: 39
Con mucho gusto amigo :D


I try just to show you an example - hope my connection does it.

Here I have taken wantingly all faces around the glas as a black mirror to come to a more graphic (photographic) result.

Rendered in Lightworks


with the Vray I'm still far away from useable results :(


But with a bit more practice... :)

Post by Changa // Apr 11, 2007, 8:43am

Changa
Total Posts: 187
pic
Prodigy, I'm not sure that you are completely right and the black color must no reflects on anything.. just not illuminate and that must not affect the transparency.. To check it stand opposite a mirror in black suit;) I think your image looks natural enough if you switch "show envoirament image" on. Most probably black at the glasses is partly reflections and partly transparency of black surround but as far as this surround is off it is just removed from areas not covered by 3D geometry of the finalized image and replaced with standard grey. Im I right, Tom ? So this situation is too artificial. Normally (without hdri) this grey background is visible through the glasses, but hdri has higher priority and "covers" 2d grey background, affects light distribution and disappeared at the end. Ufff.. Too many english words:)

Post by prodigy // Apr 11, 2007, 9:50am

prodigy
Total Posts: 3029
pic
Here is my explanation why that is not ok.


Sorry for my low lvl of english.


Are 2 thinkgs..


1) im trying to make a "Workarround" to create a "hdri" faking a photograph studio lighting.. is no importat cos i simply add 2 white planes and its the same, but i think the real light works diferent like this..


2) the problem is The black? is the absence of light.. that is clear.. If are no lights? must dont have anithing to reflect.. thats right too..


Here is clear example comming from a recent picture of a client hehehe..


Look the window. you see behind the glass it is the curtain, and if you see, the sky emits light, that light make reflection, but on the trees, more darker doesnt emit light and the light pass throw the window and you can see the curtain..

The green color is because the trees emits a little bit of light and that yes are showed on the glass but not the black parts..

5313

And here is my example with a few corel exclusion touches and thats is how the light works.. Its clearly that example is more realistic than the other.. ;)


5312

Post by prodigy // Apr 11, 2007, 10:00am

prodigy
Total Posts: 3029
pic
And here is another pic.

5314

and cos the light comming inside the room is more brighten than the outside light, are showed comming from inside over the sky reflection..

Sorry im not a physic teacher :D

Post by TomG // Apr 11, 2007, 10:05am

TomG
Total Posts: 3397
Actually the whole question is one of how reflections and transmission are accounted for in materials. Generally the approach is additive, as in Lightworks shaders (surface color lit by diffuse + reflection + transmission).


This does not account for things like "if the background behind the glass is white, then the reflection gets drowned out by the transmission". This is why I built the TG Glass shader in ShaderLab, which handles the combining of diffuse, specular, transmission and reflection in a different way, which to me gave more realistic results.


So some limitations arise in the standard mechanism for combining these features for a surface. This limitation is primarily in the shaders and render engine, and they are pretty standard as far as I can see - I never did see another shader that does what TG Glass does ;)


In the case of the glasses that Prodigy has, I think it is more than just reflection - the environment image from an HDRI also affects transmission, and I believe the raytrace through the glass is picking up the HDRI environment (ie the dark) in place of the grey neutral background color. This is not surprising, and is a limitation of the way things are done - solution would be NOT to use the background color shader, but to use a real object.


This is pretty good advice in any instance - use a real background, an actual object in the scene, rather than any sort of background shader. Then the raytracing for the refraction will not pick up on the environment from the HDRI.


It is not currently possible to tell HDRI to use the HDRI environment for reflections, but ignore it and use background color for transmission. The solution of adding a real object for it to refract though is quick and painless.


"Different rendering engines give different reflections. At least all these pictures should be same to follow logical rules"


Ah but this is all about the rendering engine. It is natural that different render engines give different results - they are coded to handle situations in a different way. You are seeing the Lightworks method of handling a background image, and it is indeed part of the render engine and not a tS item. V-Ray (the engine) clearly has done some quick emulation of wrapping the image around the scene to make the background image more useful (this sort of improvement in the render engine is one reason why V-Ray is offered as an alternative).


Again, the solution is not hard (adding in an object that has a real existence in the scene), and solves many more problems than just the one encountered here. I don't think it is anything we can fix though as it is part of the render engine code rather than part of the tS code - if a shader calls a refracted or reflected ray in Lightworks, and that ray does not impact an object in the scene, and it uses the raytrace result, the color given is the color from the pixel at that point in the background image. I encountered this in coding shaders in ShaderLab, and this is the result passed back from the Lightworks engine.


The shader can ignore that raytrace result etc, but there is now way to make it return the color from a different part of the background image. So no solution in terms of coding in tS is possible - however the solutions are pretty easy and effective to implement, so there is no major problem there :)


HTH!

Tom

Post by pixelpantscher // Apr 11, 2007, 10:18am

pixelpantscher
Total Posts: 39
Basicly you are right - as far as we are outside our computers :D

The main difference is, trees, leafs whatever are not light emitters, they simply reflect the available light - sunlight or any artificial lightsurce - does not matter.


But now lets go back to our virtual world. None of the rendering engines know that this quads, triangles or whatever in the background is a tree with leaves and that this has to reflect an amount of the available light, untill the material is not set to the required level of reflectance - and the material (glas, window, bumper of your Corvett;) ) is also knowen as reflectiv.

And here we come to the next problem.

we have now set all this to the required level of reflectanc. But does the render engine know, how your wonderfull and - as per the requirements of the window - perfectly designed material has to behave, if there is anything behind it, mostly in a distance to the material (like the curtain), which makes the window partialy behave as a mirror?:confused:


If you find one or more spelling errors in this you may keep it :D

Post by prodigy // Apr 11, 2007, 10:32am

prodigy
Total Posts: 3029
pic
Thanks both..


I just show the problem..

I know we are working on a VR envoriament

But we try to duplicate the reality.. Best Regards.

Post by pixelpantscher // Apr 11, 2007, 10:41am

pixelpantscher
Total Posts: 39
see also the good side - if everything would already work perfekt, where would be the fun in developing something new :D

Post by prodigy // Apr 11, 2007, 10:58am

prodigy
Total Posts: 3029
pic
Yup..


The E! trueSpace hollywood Storry :D

Post by kena // Apr 11, 2007, 11:24am

kena
Total Posts: 2321
pic
ok, Now I'm confused. I looked at the original image, and what I see is not reflection of black, but refraction. The glass acts like a lense. If you lower the refraction settings, do you still get the black?

Post by prodigy // Apr 11, 2007, 11:39am

prodigy
Total Posts: 3029
pic
Let my try at home...
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn