Jump to content
Sign in to follow this  
wld427

Shadow LOD

Recommended Posts

I am trying to add the shadow LOD to aome of our airfcraft for project RACS. Unfortunately someone in the past tipped me to copy first LOD and srt it as the shadow..... this resilts ine LOOOONNNNNNGGGGGG loading time and sometimes a CTD.

can anyone explain to me hiw it works and what is the propper metheds of making the shadow LOD?

Share this post


Link to post
Share on other sites

Shadow LOD needs to be very simple, also it needs a closed geometry, cannot be non-convex, must have sharp edges and be triangulated. For a start you could try building a simple shadow LOD from just boxes, also have a look at the BIS models for good reference.

I'm sure someone more competent than me can give you better tips.

Share this post


Link to post
Share on other sites

That tutorial seems to how to get shadow volume working with the old Oxygen for OFP.

Just make the LOD type into shadowvolume 0.000.

Share this post


Link to post
Share on other sites
cannot be non-convex

Not true.

The shadow volume needs:

To be closed

All sharp edges

All triangles (no quads)

No texture links

Ideally you'd want 3000 tris or less in the most detailed of shadow lods, then you'd have a couple more, at ~1500 - 1000 and ~500

Share this post


Link to post
Share on other sites
cannot be non-convex

Not true.

The shadow volume needs:

To be closed

All sharp edges

All triangles (no quads)

No texture links

Ideally you'd want 3000 tris or less in the most detailed of shadow lods, then you'd have a couple more, at ~1500 - 1000 and ~500

Really? I've seen a lot of people claiming so, if it's not required, but rather recommended it would explain a few weird phenomenon I've experienced regarding shadow volume.

Share this post


Link to post
Share on other sites

Nope.

The only place where convexity matters is the geoms. Anywhere else it doesnt matter.

Who's been spreading this false propaganda? tounge2.gif

Share this post


Link to post
Share on other sites

And your shadow LOD geometry should be INSIDE of your other geometry, otherwise you will have shading appear on the outside of your model. This is the toughest part of creating a shadow LOD.

I make my shadow LOD in 3dsMax, and make it a sharp green color so I can quickly check if it is poking outside of the model I have made.

Share this post


Link to post
Share on other sites
Guest RKSL-Rock
And your shadow LOD geometry should be INSIDE of your other geometry, otherwise you will have shading appear on the outside of your model.  This is the toughest part of creating a shadow LOD.

...

You can get around that by simply inverting the mesh.

Share this post


Link to post
Share on other sites

thanks guys got it working propper. needed to do everything in the right order.

Share this post


Link to post
Share on other sites

This is a more accurate 'guide': http://community.bistudio.com/wiki/Oxygen_2_-_Manual

Go to point 13.3....

@Rock: hm for me inverted models causes strange shadows...maybe this is (only) true on non complex objects?

If time allows i will recheck it though. As sometimes (mostly on smooth stuff like cilinders) the clipping shadows can be nasty and hard to fix (downscaling often helps).

@DM:

Quote[/b] ]then you'd have a couple more, at ~1500 - 1000 and ~500

Can you explain me please how this is done? I mean afaik one can only use 2 shadowvolume lods, namely 0.00 and 10.00. So i wonder how you can make more? Imho shadows are very important and i personally like good and accurate shadows but that is often hard if you want or need to keep it pretty low in triscount. So shadowLODS that more or less go hand in hand with the res lods would be something i would like to learn how to implant. If the mythes are correct, polycount isn't a real issue...as sections and textures are more of an performence impact for the hardware. So a smooth shadow translating Lod system would be interesting to make.

Share this post


Link to post
Share on other sites

Photo1-3.jpg

why does my shadow produce this effect on my vehicle? Whats needed to fix this?

thanks

Eddie

Share this post


Link to post
Share on other sites
Can you explain me please how this is done? I mean afaik one can only use 2 shadowvolume lods, namely 0.00 and 10.00. So i wonder how you can make more?

The tools I've got, Shadow Volume LoDs work the same way as reslution LoDs.

I.e. right click on it, properties, and change the value at the bottom.

?

Share this post


Link to post
Share on other sites
Quote[/b] ]Dm: The tools I've got, Shadow Volume LoDs work the same way as reslution LoDs.

I.e. right click on it, properties, and change the value at the bottom.

Yup, but i mean, in your original post you said

Quote[/b] ]then you'd have a couple more, at ~1500 - 1000 and ~500

so i assume you mean have multiple (in your case 4) ShadowVolume lods. But afaik, it is only possible to use values 0.00 and 10.00 where last should best should contain simple face (so no volumes). So i wonder what shadowvolume resolution numbers one can use  huh.gif . A few days ago i tried lod 16.00 as my res lod 16.00 changed pretty must so i wanted to have a new shadowvolume that would fit the res geo more. But apperently it isn't 'linked' to the same numbers. Understand?

Beside afaik i haven't seen any model that uses more then 2 volume lods (0.00 and 10.00 only).

Quote[/b] ]why does my shadow produce this effect on my vehicle? Whats needed to fix this?

Wild guess here, but isn't this bug more or less related to aircrafts only? I remember Gnat (or someone else) having the same problem....on the ground and until a certain height the shadow worked fine though.

Share this post


Link to post
Share on other sites
so i assume you mean have multiple (in your case 4) ShadowVolume lods. But afaik, it is only possible to use values 0.00 and 10.00 where last should best should contain simple face (so no volumes). So i wonder what shadowvolume resolution numbers one can use huh.gif . A few days ago i tried lod 16.00 as my res lod 16.00 changed pretty must so i wanted to have a new shadowvolume that would fit the res geo more. But apperently it isn't 'linked' to the same numbers. Understand?

Beside afaik i haven't seen any model that uses more then 2 volume lods (0.00 and 10.00 only).

Shadow lod numbers work the same way as the resolution lod numbers (afaik)

Thus the logical process would be to have shadow volume 0 -> 1 -> 2 -> 3

The work that I do regularly has shadow volumes 0, 5 and 10 (not entirely sure why, will have to ask about that)

The shadow volume numbers do not link them to the res lod numbers, the relevant lod (shadow or resolution) will be displayed according to the engines load calculations and settings. I.e. LoD 0 and Shadow Volume 10 may be displayed together if you have model detail set to hig and shadows set to low.

Share this post


Link to post
Share on other sites
Guest RKSL-Rock
why does my shadow produce this effect on my vehicle? Whats needed to fix this?

thanks

Eddie

There are two situations I've seen this:

1) You are using the OFP method of creatring shadows or have lodnoshadow = 0 in some lods

2) Textures/materials applied to the shadow mesh

Since you are converting from OFP i'd go with the lodnoshadow as the likely cause.

Share this post


Link to post
Share on other sites

Since you guys are on the subject of shadowsVolume's, I thought I might ask about alpha'd shadows like those found in vegetation.

Ive been looking at plants and trees in O2 and I've noticed that alot of vegetation that you wouldnt expect to use stencil shadows has solid shadow geometry in ShadowVolume 0.000 like for example, the banana_2.p3d, no stencil shadows are cast from the model in bulldozer, so thats used for lower settings? the only shadows being cast are from shadowVolume 1000.000 which is a model with an alpha'd texture applied to it (same texture used for lod 3.000) and casts the shadow like a shadowmap.

bananashadowsyx8.jpg

I've been trying to reproduce these shadows for my own plants but with no luck, the only shadow that I get is from the shadowVolume 0.000, afaik my model is exactly the same as the banana plant apart from the geometry and textures

shadowsnr7.jpg

I can get shadows to cast from lod 1 if I delete all the  shadowVolumes from my model, but I imagine thats a very inefficient way to cast shadows

Share this post


Link to post
Share on other sites
And your shadow LOD geometry should be INSIDE of your other geometry, otherwise you will have shading appear on the outside of your model.  This is the toughest part of creating a shadow LOD.

...

You can get around that by simply inverting the mesh.

can anyone back this up? does this actually work?

Share this post


Link to post
Share on other sites

Regarding the saw tooth, I believe that problem occurs when you have your shadows set to high or very high. It's about how arma calculates the shadows, using either CPU or GPU.

Share this post


Link to post
Share on other sites

@mikebart

Not quite sure what is not working, but there are few things you could check.

In the geo lod. Could try put these named properties if they are not there yet.

name - value

--------------------

shadow - hybrid

sbsource - explicit

prefershadowvolume - 0

Those are used in the BIS banana plant.

Also if making plants, you might better add "canOcclude - 0" or basicly just copy all the stuff from the banana named properties.

Share this post


Link to post
Share on other sites
And your shadow LOD geometry should be INSIDE of your other geometry, otherwise you will have shading appear on the outside of your model.  This is the toughest part of creating a shadow LOD.

...

You can get around that by simply inverting the mesh.

can anyone back this up? does this actually work?

Just to quote myself.

I did just test this out YES it DOES work perfectly. Just make sure everything else is right:

- low enough polycount (copy/paste 1st lod is NOT an option)

- no open topology

- all triangulated

- no useless things in it

This is pretty good as staying within the model volume is hard and annoying.

Share this post


Link to post
Share on other sites

@Aqu; thanks for the help, I cant find the config for the banana plant, ive tried running the model config editor from the banana.p3d in O2 but im getting an error, where did you find the banana config? it doesnt seem to be in with the bi sample models.

edit: this is the error im getting: Error: CreateSelectionList failed - skeleton definition not found in config

Share this post


Link to post
Share on other sites

@Mikebart

I don't think banana has any specific config. There is only the generic plant config. Banana and other plants are classless objects which cannot be created in the mission editor or in scripts.

If you want to make a class for your Banana so that you can place them outside Visitor, you could make it yourself. Bit this style (not tested)...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class Thing;

class MikeBart_Plant : Thing

{

   scope = private;

   VehicleClass="Objects";

   model="";

   picture="";

   icon="\ca\data\data\Unknown_object.paa";

   accuracy=1000; // never recognize

   mapSize = 2;

   armor=2;

   cost = 0;

   side=4; // TSideUnknown

   Crew="";

   nameSound="";

   hasGunner = 0;

   hasCommander = 0;

   hasDriver = 0;

   irTarget=false;

   destrType = DestructTree;

   simulation = "thing"; // not sure about this, could try other if this doesn't work well

   submerged = 0;

   submergeSpeed = 0.0;

   maxSpeed = 0;

   fuelCapacity = 0;

   threat[]={0.0, 0.0, 0.0};

   transportAmmo = 0;

   transportRepair = 0;

   transportFuel = 0;

   soundEngine[] = {"",1,1};

   soundEnviron[] = {"", 1, 1};

};

class MikeBart_Banana: MikeBart_Plant

{

   scope=public;

   displayName="Mike's banana";

   model= "\MIKEBART_Banana\banana.p3d"; // YOUR BANANA P3D path here!

};

Using that sort of config might make it not work like a plant though (not move with wind etc). Also many of those values might need bit tweaking.

Did you check the named properties in the Oxygen? Also the plant behaviour is set there (class = treeSoft, dammage=tree)

Share this post


Link to post
Share on other sites

Alright!, I found the named propertys and filled it in like you suggested, the shadow works properly now and it gently sways back and forth in the wind like other arma plants, thats something I never thought i'd acheive smile_o.gif

Thanks heaps for all the help Aqu.

Share this post


Link to post
Share on other sites

It look like that i have a problem with the shadow lod

i see only shadow outside the building and no shadow on the building

look on the pic :

tower.jpg

i dont any more , get grazy from this banghead.gifconfused_o.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×