• Welcome to SC4 Devotion Forum Archives.

Casting shadows on props

Started by SimFox, April 17, 2009, 09:09:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SimFox

I have a little moding request concerning Voltaic Roundabouts



I think the props have to be set NOT to be ground modles that way they would receive shadows from the game objects (including the trees placed on them in LOT editor and be blending FAR better into the game. Now the fact that there is no shadows under the tree, but then it starts on the road is totally unneessary eyesore.
I've tried to do said alteration for the files already merged into DAT, but it doesn't work.
Actually if you examine those it is a mess FSHs don't match the modles, etc... It all works in game however, but as I've said changing the IsGroundModel property has no effect...
So I believe that original should be moded properly and then merged into single DAT again...

Hope I was somewhat intelligible in what I've said...

exziviben

SimFox:
The tree cannot show shadow on props. Andreas can say more them if he is back in a few days.

SimFox

Actually it can if moded properly...
I would have done it myself but the files in the DAT are messed up...

Andreas

SimFox, to my knowledge, props cannot cast shadows on other props, at least it didn't work in my tests. I set the "Is Ground Model" property for the roundabout props to "false", but the shadow of the tree was still "cut off". What do you mean by "properly modded"? I don't know why the S3D files are messed up in the Reader display, but the models itself should be fine, as I haven't touched them other than merging the files into a DAT.
Andreas

SimFox

#4
the fact that display in Reader is messed is an indication of the fact that there is something wrong with either the file or with the way Reader can access it.

Proper modng is, in fact setting that property to False, nothing more to it really... In that case prop doesn't cast shadow but receives one instead.

here is an example of the roundabout I've made (just because  of that problem with SFBT one):


as you can see the tree casts the shadow onto the filler prop as well as on the road.

and here is example as it interacts with other lots. See the shadow of the building that falls onto the roundabout filler prop.



As I set the DAT is somehow corrupt. You should simply create new (propperly moded ) Desc from original SC4Model.

Andreas

I'll check that again. I got the models and prop exemplar files from voltaic, not sure if something went wrong during the modding process.
Andreas

Andreas

@SimFox: I had some time to investigate the shadow issue - and I can only reiterate what I observed earlier: The game won't cast any shadows on props, regardless if the "Is Ground Model" property is set to "True" or "False". Take a look at the following pic:



I removed voltaic's DAT with the merged props and added the original files back into my plugins folder. The S3D files show up fine in the Reader, so I assume everyting is ok with the models. Then I set the "Is Ground Model" property of the roundabout in the middle (the greener one) to "false", and the one on the right to "true". I also plopped a Maxis basketball field lot as a reference. As you can see, the basketball field prop with the basket doesn't cast any shadows, so the "Is Ground Model" property of that one was set to "false", while the streetlight prop clearly casts a shadow - but not on the basketball field prop!

Could you try the same on your system? Maybe my graphics card (Matrox P650) isn't capable of rendering shadows properly? Or maybe your props work different, due to the fact that they were created in 3DStudioMax, rather than in gmax, like voltaic's roundabout filler? I would assume that Maxis also used 3DStudioMax, but maybe with a different setup.
Andreas

SimFox

and I would have to reiterate that this shouldn#t be a problem...

here you see one prop (tree) casting shadow on another prop (roundabout circle)



and here both prop (tree) and nearby building both cast the shadow on a prop (roundabout circle)


AS for particular prop I know that altering this property in DAT didn't work. That's why I asked your assistance...

I wonder what would be a reason for this not working in your case... Could you send me the original SC4Modle file for a roundabout circle so I could have a go at it?

Diggis

Hmmm, that is weird on the ground models.  One thought, is the model the building or the prop is both cases?  I would assume both are just props. 

Also maybe it's a setting with the Lot? 

And finally, what about the LOD height?  What height did you use SF?

Andreas

@Jan: Thanks for the hint, I'll keep that in mind when someone else is asking.

@SimFox: Well, my pic shows that even the Maxis props have the same behavior, and that's what I'm used to. The "shadow ability" must come from something else. I've attached the roundabout model files, so see for yourself, if you like.
Andreas

SimFox

Ok I've made a little investigation and here are results...

Actually it was Diggis who had proposed the correct hypothesis about the condition to be met in order for a prop to receive the shadow.
It actually is a height of the LOD. And the critical number appears to be 0.3 meters. Also this appears to be only and enough condition, meaning that IsGroundModel doesn't need to be set to false. Even if true  model will still receive shadow (at least in case of the prop, haven't tested building).

My Roundabouts use 0.25m tall LODs so, naturally they were receiving Shadows and Voltairen's ones had 1.69 m tall LODs and that's the reason they didn't. Ground model or not.

here is what happens when I mover vertecies in Reader to 0.3m:



So, if these are to be fixed they would have to be re-exported. Luckily LODs on these could safely be lowered to under 0.3m with no consequence to the model.

Andreas

Interesting find! I'll discuss the issue with voltaic, maybe he can update his models accordingly. Unfortunately, he's dealing with some RL issues at the moment, so it might take a while.
Andreas

SimFox

yep... it wouldn't need any alteration apart form LODs

Diggis

#13
The reason I queried it was because is ground model sets whether the model cast's shadows.  I have to set it to false for my stream models as it's underground and you get weird shadows.  Good to know it's the height (I was just testing that now myself).

I've had a quick test and will do some more but it appears this is soley LOD based, and is not affected by the height of prop exemplar.  I will test this further tonight, but it's a good find.

SimFox

I can confirm that.
Sorry i wasn't quite thorough enough in my previous messages.
I've tested the numbers in Exemplars and they bare no influence on this phenomenon what so ever. It is all due to the hight of the LOD.

Diggis

Did you try with complex LODs?  I am guessing that if the LOD had a step in it that went up to say 1m then they shadow wouldn't show at that point, but would show on the rest of it, but it may just read the top vertex and say no shadows at all.

SimFox

1m step? Well, where could such a step be if as I've said the top hight of vertex along S3d's Y axis that still allow to receive full uninterrupted shadow is 0,3m increase this even a a couple of cm and you'll get a comb effect and at 0.4m  no shadow at all.
here is an illustration:


in that model back top vertecies were risen to the hight of 1 m while front ones remain at default 9cm. You can see how shadow disappear through the "comb" stage as the 0.3 and 0.4m levels are breached 


PS
sorry for commandeering SFBT thread for this theoretical discussion...

Diggis

Thats cool, pretty much what I expected.

Andreas

I split the postings from the SFBT topic and moved them here, where it's more appropriate. :)
Andreas

Diggis

Have found one problem with this, it doesn't work for partially transparent props (ie, with a gradient Alpha).  When you change the settings you get the shadow showing up, but it ignores the model and shows the ground below.



I've tracked it down with early tests to the check box for framebuffer blending, although I need to check this.  Without the box ticked you get normal shadows but no transparency. This was with all the other settings as per normal for gradient transparency.  I need to check if ticking the box with settings normal will have the same effect.