Difference between revisions of "Translucency"

From Terragen Documentation from Planetside Software
Jump to: navigation, search
(Created page with "===Background=== Translucency is an effect which gives the appearance of light filtering through an object. An example of this is a leaf on a tree, up against the sky. When you l...")
 
Line 1: Line 1:
 
===Background===
 
===Background===
Translucency is an effect which gives the appearance of light filtering through an object. An example of this is a leaf on a tree, up against the sky. When you look at the leaf from the ground the leaf looks lit up by light passing through it from the other side. This is the effect translucency gives.
+
Translucency gives the appearance of light filtering through an surface. An example of this is a leaf on a tree, up against the sky. When you look at the leaf from the ground the leaf looks lit up by light passing through it from the other side. This is the effect that translucency gives.
  
The translucency effect in Terragen 2 essentially fakes this effect. It works by changing the brightness of the lighting for the side of the surface which is opposite the side that light is coming from. Normally the side of the surface facing away from the light would be darker, because less light is hitting it. However by changing the brightness of the lighting for the surface facing away from the light you can get an effect of some light passing through the surface.
+
The translucency effect in Terragen 2 essentially fakes this. It doesn't actually simulate light passing through the surface. It works by changing the brightness of the lighting for the side of the surface which is opposite the side that light is coming from. Normally the side of the surface facing away from the light would be darker, because less light is hitting it. However by changing the brightness of the lighting for the surface facing away from the light you can get an effect of some light passing through the surface.
  
 
It is important to note that translucency is not the same as opacity. Opacity is the same concept as transparency or alpha. When you set opacity to 0 a surface becomes invisible. If you set translucency to it's highest setting the surface will still be completely visible but it will look brighter on the side facing away from lighting.
 
It is important to note that translucency is not the same as opacity. Opacity is the same concept as transparency or alpha. When you set opacity to 0 a surface becomes invisible. If you set translucency to it's highest setting the surface will still be completely visible but it will look brighter on the side facing away from lighting.

Revision as of 04:05, 4 July 2012

Background[edit]

Translucency gives the appearance of light filtering through an surface. An example of this is a leaf on a tree, up against the sky. When you look at the leaf from the ground the leaf looks lit up by light passing through it from the other side. This is the effect that translucency gives.

The translucency effect in Terragen 2 essentially fakes this. It doesn't actually simulate light passing through the surface. It works by changing the brightness of the lighting for the side of the surface which is opposite the side that light is coming from. Normally the side of the surface facing away from the light would be darker, because less light is hitting it. However by changing the brightness of the lighting for the surface facing away from the light you can get an effect of some light passing through the surface.

It is important to note that translucency is not the same as opacity. Opacity is the same concept as transparency or alpha. When you set opacity to 0 a surface becomes invisible. If you set translucency to it's highest setting the surface will still be completely visible but it will look brighter on the side facing away from lighting.

Using Translucency[edit]

Typically translucency is controlled with a colour. These controls can be set up two ways. The Default Shader uses a standard colour parameter with a colour button and brightness slider. The Image Map Shader uses a slider for translucency and then a standard colour parameter for a tint colour. The translucency slider effects the brightness of the tint colour in the same way that a standard colour parameter brightness slider does, the outcome being that you have a single colour used for controlling translucency.

The translucency colour is used to multiply the diffuse lighting on the side of surfaces facing away from the light. If the translucency colour is black, in other words all channels of the colour are 0, then there will be no change in the lighting. It's the same as turning translucency off. As the translucency colour gets brighter (closer to white) the brighter the lighting gets and the brighter the surface becomes.

It might help to think of the translucency colour as a channel by channel brightness filter. For example black turns transparency off because all channels of the colour are 0. However if you used red for the translucency colour then the red channel would be set to 1 while the other channels would be 0. This means that the translucency effect would only be applied to the red channel of the lighting colour. It would also mean that the surface colour takes on a red tint from the redder light.

This is an important point to remember. If you only want the translucency effect to make the surface colour brighter without tinting it then you should use shades of grey for the translucency colour. Paler shades of grey give brighter results. Using colours other than shades of grey will tint the lighting, which might be a desirable effect in some cases.

Let's look at a practical example of using translucency. Probably the most common use for the effect is to make leaves on plants look more realistic. Some plants have leaves which let very little light through but for many other plants it's an important characteristic of their appearance. A good example this is an oak tree. Look at the two images below. The one on the left has no translucency applied to the leaves. The one on the right uses translucency.

You can see there is a big difference. The oak without translucency on the leaves looks like a silhouette whereas the the one on the right looks much more like the green and leafy oak trees you might have seen. It is important to note that the sun is behind and to the right of the tree. If the sun was shining more in the direction of the camera there will be less of an effect from the translucency. There's two examples below. Translucency is used in the image on the right.

To change the translucency of the leaves you need to find the shader used for the leaves. Normally this is a Default Shader. When you have found the leaf shader you can then set the Translucency parameter to an appropriate setting. For the images above I used 0.675. As mentioned above you should use shades of grey if you don't want to tint the lighting colour. The easiest way to do this is to choose black or white for the colour (black is the default) and then use the slider to change the brightness. The colour slider makes it easy to tweak the brightness until you have the desired effect.

The images below shows what happens if you use a colour other than a grey or white for translucency. In this case red was used and you can see the leaves have been tinted red. The image on the right has the sun shining in the direction camera. You can see very few leaves are showing the red tint, as most of the light is coming from the front.

Some shaders allow you to use a function and/or image to further control translucency. You could use this to make certain parts of a surface more translucent than others for example. When these additional controls are used they are multiplied with the translucency colour and then applied to the lighting. One important consequence of this is that if you want translucency to be controlled solely by a function or image you need to set the translucency colour to white. This allows the function or image colours to come through unchanged.

A parameter is an individual setting in a node parameter view which controls some aspect of the node.

A shader is a program or set of instructions used in 3D computer graphics to determine the final surface properties of an object or image. This can include arbitrarily complex descriptions of light absorption and diffusion, texture mapping, reflection and refraction, shadowing, surface displacement and post-processing effects. In Terragen 2 shaders are used to construct and modify almost every element of a scene.