User Tools

Site Tools


arma:modeling:shadows

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
arma:modeling:shadows [2008-06-28 10:37]
snakeman added more data and some formatting etc
arma:modeling:shadows [2015-08-22 01:45] (current)
Line 3: Line 3:
 Used for HW shadow casting. The shadows are cast from this LOD on resolution LOD surfaces. The shadow volume area is made by extruding the lit faces of the shadow LOD (faces that have normals oriented towards the light) in the light direction. Used for HW shadow casting. The shadows are cast from this LOD on resolution LOD surfaces. The shadow volume area is made by extruding the lit faces of the shadow LOD (faces that have normals oriented towards the light) in the light direction.
  
-LOD should be as simple as possible, to represent the 1st LOD shape and all its important parts. The shape should not exceed 1st LOD volume. Maximum ​polycount ​for shadowVolume is 1000 triangles.+LOD should be as simple as possible, to represent the 1st LOD shape and all its important parts. The shape should not exceed 1st LOD volume. Maximum ​poly count for shadowVolume is 1000 triangles.
  
 All components must be Closed (each edge must have 2 neighbor polygons) – check with Structure -> Topology -> findNonClosed. Normals can be oriented both ways, depending on desired purpose of the specific shadow LOD surface/​component. This lod should not contain any texture or material All components must be Closed (each edge must have 2 neighbor polygons) – check with Structure -> Topology -> findNonClosed. Normals can be oriented both ways, depending on desired purpose of the specific shadow LOD surface/​component. This lod should not contain any texture or material
Line 13: Line 13:
 LOD must be named ShadowVolume 0.000, ShadowVolume 10.000 or ShadowVolume 1000.000 LOD must be named ShadowVolume 0.000, ShadowVolume 10.000 or ShadowVolume 1000.000
  
-  * Shadow volume 0 is the main stencil shadow. It shuould ​have less than 1000 triangles.  +  * Shadow volume 0 is the main stencil shadow. It should ​have less than 1000 triangles.  
-  * Shadow Volume 10 is optimised ​stencil shadow LOD with as few triangles as possible. ​+  * Shadow Volume 10 is optimized ​stencil shadow LOD with as few triangles as possible. ​
   * Shadow 1000 is special for trees, it uses alpha transparent textures to be calculated using GPU shadow buffer. (so this lod can have link on texture)   * Shadow 1000 is special for trees, it uses alpha transparent textures to be calculated using GPU shadow buffer. (so this lod can have link on texture)
  
Line 32: Line 32:
  
 For trees and vegetation there can also be used so called HYBRID SHADOW. This is controlled by model property Shadow=hybrid in Geometry LOD Those shadows are cast on all models except the model itself. Trees can use special shaders for leaves that simulates self shadowing. For trees and vegetation there can also be used so called HYBRID SHADOW. This is controlled by model property Shadow=hybrid in Geometry LOD Those shadows are cast on all models except the model itself. Trees can use special shaders for leaves that simulates self shadowing.
 +
  
 ====== ShadowVolume on BIS MLODs ====== ====== ShadowVolume on BIS MLODs ======
Line 133: Line 134:
 PrefersShadowVolume = 0\\ PrefersShadowVolume = 0\\
 the LODs must be closed and triangulated. the LODs must be closed and triangulated.
 +
  
 ====== Shadow Tutorial by Skaven ====== ====== Shadow Tutorial by Skaven ======
Line 146: Line 148:
 PS: Don't forget to delete the textures applied on the Shadows model (if you have any) since it's all black you don't need it mapped. PS: Don't forget to delete the textures applied on the Shadows model (if you have any) since it's all black you don't need it mapped.
  
-3 - Open a property inside your 10000 Lod and call it LODNoShadow the value is 0+3 - Open a property inside your 10000 LOD and call it LODNoShadow the value is 0
  
-4 - Open the same property (LODNoShadow) in all the other Lods but this time give it a value of 1.+4 - Open the same property (LODNoShadow) in all the other LODs but this time give it a value of 1.
  
 5 - Inside the Shadow Lod (10000) with the entire model selected go to Structure/​Topology/​Find non-Closed and check if you have any opened point/faces (they get red if you do and below on your left O2 tells you the amount of them).  ​ 5 - Inside the Shadow Lod (10000) with the entire model selected go to Structure/​Topology/​Find non-Closed and check if you have any opened point/faces (they get red if you do and below on your left O2 tells you the amount of them).  ​
Line 162: Line 164:
 Model needs to be closed, triangulated AND sharp edged Model needs to be closed, triangulated AND sharp edged
  
-You can have more than 400 polies ​in the shadow LOD. I'​ve ​expirmented ​with a 1000 poly model up to 4000 poly. It worked but with varying loading results. So it's best to keep it low to keep preformance ​up.+You can have more than 400 poly'​s ​in the shadow LOD. I'​ve ​experimented ​with a 1000 poly model up to 4000 poly. It worked but with varying loading results. So it's best to keep it low to keep performance ​up.
  
-i found that shadows on vehicles works no matter if triangulated or not no matter LOD 30 or 10000 but on my weapons i get really stupid results i don't know why, but soemtimes ​my weapons (after close, triangulate,​ 10000) look like zebra so i decided not to give shadows, now i work on making ​jnew low-poly models for shadows, but what if shadow model is diffenent ​than LOD models ?\\+i found that shadows on vehicles works no matter if triangulated or not no matter LOD 30 or 10000 but on my weapons i get really stupid results i don't know why, but sometimes ​my weapons (after close, triangulate,​ 10000) look like zebra so i decided not to give shadows, now i work on making ​new low-poly models for shadows, but what if shadow model is different ​than LOD models ?\\
 inner shadow can cause sick effects on weapons ? inner shadow can cause sick effects on weapons ?
  
Line 172: Line 174:
  
 i gave no "​LODNoShadow = 1", i gave LOD 10000 (as i was told)\\ i gave no "​LODNoShadow = 1", i gave LOD 10000 (as i was told)\\
-i gave model with lower polycount ​as i it was in OFP maybe there should be more detailed model ?\\ +i gave model with lower poly count as i it was in OFP maybe there should be more detailed model ?\\ 
-all faces are closed, no "​open"​ or "​hole"​ faces and weapons look really ​reall sick than +all faces are closed, no "​open"​ or "​hole"​ faces and weapons look really ​really ​sick than 
  
 half of gun is almost black on the soldiers there is "​zebra"​ of shadow half of gun is almost black on the soldiers there is "​zebra"​ of shadow
 +
  
 ====== Notes ====== ====== Notes ======
Line 183: Line 186:
 ArmA engine uses Shadow Volume 0, Shadow Volume 10 and Shadow Volume 1000. Different values than that are not used. ArmA engine uses Shadow Volume 0, Shadow Volume 10 and Shadow Volume 1000. Different values than that are not used.
  
-Shadow volume 0 is the main stencil shadow. It shuould ​have less than 1000 triangles.+Shadow volume 0 is the main stencil shadow. It should ​have less than 1000 triangles.
  
-Shadow Volume 10 is optimised ​stencil shadow LOD with as few triangles as possible.+Shadow Volume 10 is optimized ​stencil shadow LOD with as few triangles as possible.
  
 Shadow 1000 is special for trees, it uses alpha transparent textures to be calculated using GPU shadow buffer. Shadow 1000 is special for trees, it uses alpha transparent textures to be calculated using GPU shadow buffer.
  
-Source [[http://​www.flashpoint1985.com/​cgi-bin/​ikonboard311/​ikonboard.cgi?;​act=ST;​f=76;​t=68241|BIS forum topic]]. 
  
-**Earl (BIS dev)**: The only named property that should always be used is "​LODNoShadow=1"​ on all visual LODs which are >400 faces.+===== Earl Summary ===== 
 + 
 +**Earl (BIS dev)**: The only named property that should always be used is "​LODNoShadow = 1" on all visual LODs which are >400 faces
 + 
 +Default behavior should be: 
 + 
 +  * Use high detail SV LOD to draw stencil shadow 
 +  * At distance use lower detail SV LOD to draw stencil shadow 
 +  * At greater distance, use last or lower visual LODs for shadow map source, and start to fade that shadow away. 
 + 
 + 
 +===== Hand Rails ===== 
 + 
 +**Armored_Sheep** (BIS Dev) about handrail modeling in houses: Stencil buffer shadows (those sharp polygons) are not able to use alpha transparency. They are drawn by extruding triangles from ShadowVolume lod. 
 + 
 +If you choose shadow buffer casting (used on trees) you can have alpha transparent textures in shadow casting lod (you define this by properties in geometry lod) BUT you will be still limited by texture resolution (ArmA casts this shadow using single 2048x2048 texture for whole scene) 
 + 
 +At this particular model I suppose to don't put the rail in the shadow at all. (PMC edit: means its either no shadow, or model a real handrail with polygon'​s not just one face with alpha channel texture). 
 + 
 + 
 +====== Closing Model ====== 
 + 
 +modEmMaik about closing shadowvolume lod mesh: 
 + 
 +I open up another O2, copy and paste the single element, which is not close-able, and try to detect the problem. 
 + 
 +Sometimes faces are doubled, which you may detect in the solid view and switch the faces (w-button). 
 + 
 +Sometimes the mesh is not closed because one edge in one face is splitt (one additional point in the same line). It looks closed, but it is not.
  
-Default behaviour should be:+When it is closed, I copy the mesh back.
  
-  * Use high detail SV lod to draw stencil ​shadow +Best check for shadow ​LOD is to create a big box in the first visual ​LODinvert the faces (w-button) of this box and check the result in the buldozer.
-  * At distance use lower detail SV lod to draw stencil shadow +
-  * At greater distance, use last or lower visual ​lods for shadow map source, and start to fade that shadow away.+
arma/modeling/shadows.1214649460.txt.gz · Last modified: 2008-06-28 10:37 by snakeman