User Tools

Site Tools


hpl3:tutorials:material_translucent

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
hpl3:tutorials:material_translucent [2011/11/29 20:55]
thomas [Steps]
hpl3:tutorials:material_translucent [2011/11/29 21:21] (current)
thomas [Steps]
Line 7: Line 7:
 ===== Steps ===== ===== Steps =====
  
-**1) Setting up the model.**\\+==== 1) Setting up the model. ​====
 First of all the model needs to be be set up and have a diffuse texture set to it (more info [[hpl3:​engine:​model_export#​modelling|here]]). The file we have are:\\ First of all the model needs to be be set up and have a diffuse texture set to it (more info [[hpl3:​engine:​model_export#​modelling|here]]). The file we have are:\\
 ''​transbox.dae''​\\ ''​transbox.dae''​\\
 ''​transbox.dds''​\\ ''​transbox.dds''​\\
 Now we open transbox.dae up in the modelviewer and will see:\\ Now we open transbox.dae up in the modelviewer and will see:\\
-{{:​hpl3:​tutorials:​material_trans01.jpg?​direct&​300|}}\\+{{:​hpl3:​tutorials:​material_trans01.jpg?​direct&​500|}}\\
 The files we have are now: The files we have are now:
 ''​transbox.dae''​\\ ''​transbox.dae''​\\
Line 22: Line 22:
  
  
-**2) Changing to Translucent.**\\+==== 2) Changing to Translucent. ​====
 Now open up MaterialEditor (leave modelviewer open) and open "​transbox.mat"​. Here change the type to "​translucent"​ and the blend mode to "​mul"​ (you can use other blend modes, but mul is often the best when dealing with translucent surfaces).\\ Now open up MaterialEditor (leave modelviewer open) and open "​transbox.mat"​. Here change the type to "​translucent"​ and the blend mode to "​mul"​ (you can use other blend modes, but mul is often the best when dealing with translucent surfaces).\\
-{{:​hpl3:​tutorials:​material_trans02.jpg?​direct&​300|}}\\+{{:​hpl3:​tutorials:​material_trans02.jpg?​direct&​600|}}\\
 Chose "​Save"​ in the file menu.\\ Chose "​Save"​ in the file menu.\\
 You can now simply task switch to the modelviewer (no need to close and open) and the changes will appear).\\ You can now simply task switch to the modelviewer (no need to close and open) and the changes will appear).\\
-{{:​hpl3:​tutorials:​material_trans03.jpg?​direct&​300|}}\\+{{:​hpl3:​tutorials:​material_trans03.jpg?​direct&​500|}}\\
  
  
-**3) Adding Reflection**\\+==== 3) Adding Reflection ​==== 
 The material looks a bit more translucent,​ but there is still a lot more that can be done. The next thing is to add a cubemap that will form an environment map for the material.\\ The material looks a bit more translucent,​ but there is still a lot more that can be done. The next thing is to add a cubemap that will form an environment map for the material.\\
  
Line 37: Line 37:
  
 Now in the MaterialEditor,​ check the CubeMap checkbox and then select the cubemap you have created. You will now see that box has gotten a reflection:​\\ Now in the MaterialEditor,​ check the CubeMap checkbox and then select the cubemap you have created. You will now see that box has gotten a reflection:​\\
-{{:​hpl3:​tutorials:​material_trans04.jpg?​direct&​300|}}\\+{{:​hpl3:​tutorials:​material_trans04.jpg?​direct&​600|}}\\
 You can now play around the the frensel properties to change how the reflection changes depedning on the slope of the surfaces. The default values are pretty good in most cases though.\\ You can now play around the the frensel properties to change how the reflection changes depedning on the slope of the surfaces. The default values are pretty good in most cases though.\\
 More importantly,​ if you have a rounded objects (unlike this cube) try changing the two RimLight parameters to get a nice glow around the edges that enchances the shape of the objects.\\ More importantly,​ if you have a rounded objects (unlike this cube) try changing the two RimLight parameters to get a nice glow around the edges that enchances the shape of the objects.\\
 Finally the AffectedByLightLevel parameter should be checked if you know that the object will be in an environment where the general light level change a lot. What it does is to make the opacity of the model depedning on the average light the model is in and makes it not seem glowing when in darkness. Can keep this off as default as it takes a  bit cpu resources and turn on if it turns out it is needed. Finally the AffectedByLightLevel parameter should be checked if you know that the object will be in an environment where the general light level change a lot. What it does is to make the opacity of the model depedning on the average light the model is in and makes it not seem glowing when in darkness. Can keep this off as default as it takes a  bit cpu resources and turn on if it turns out it is needed.
 +
 +==== 4) Adding Refraction ====
 +Still the model does not look as much as translucent as it could be. What you want to add then is refraction. To do this, simply check the boxe saying "​Refraction"​. What this does is that it gives the background a bit of an offest simulating that light refracts through the material (not that visible on this cube). Also play with "​RefractionScale"​ which changes how much the background is distorted (do not overdo this since the model might look strange up close if too high).\\
 +{{:​hpl3:​tutorials:​material_trans05.jpg?​direct&​600|}}\\
 +Switch to the Modelviewer (again no need to restart) and the effect is quite visible:\\
 +{{:​hpl3:​tutorials:​material_trans06.jpg?​direct&​500|}}
 +
 +Sometimes the geometry of the mesh is not enough to give proper refraction and in that case, you need to add a normalmap. So now the file "​transbox_nrm.dds"​ is added to the same folder as transbox.dae,​ etc. Open the MaterialEditor,​ select NMap and pick the texture:\\
 +{{:​hpl3:​tutorials:​material_trans07.jpg?​direct&​600|}}\\
 +You also want to check the parameter "​RefractionNormals"​. With this on, the normalmap normals are rotated according to mesh normals, creating a better refractive feel. In some cases this is not wanted, but for most objects it is! And as always simply save and task switch to the modelviewer to see the texture with your model:\\
 +{{:​hpl3:​tutorials:​material_trans08.jpg?​direct&​500|}}
 +
 +Note that refraction is quite demanding, especially when there are a lot of objects with it in view at the same time. So if you want to have lots of glass shards or similar, then skip it for them. For most objects it should be no problem.\\
 +Also another trick is that whenever possible make sure that as many objects as possible are combined when they have refraction. For example, if a model has three windows, each with refraction, do NOT add these as three submeshes. Instead combine them all into one submesh, and that can lead to nice speed-ups!
  
  
  
hpl3/tutorials/material_translucent.txt ยท Last modified: 2011/11/29 21:21 by thomas