• 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'm left a bit confused by this presentation...
Quote
When you change the settings you get the shadow showing up, but it ignores the model and shows the ground below.

what settings do you mean? the ones that enable the transparency blending?
What exactly "ignores model" means...  you say it shows the ground below, but isn't it where the model should become transparent? Or what should it show there then?

Diggis

Yeah, if you look at your images you will see the shape and lines of the model under the shadow.  However in my picture you can see the pattern of the grass under the whole model, including the area where the visible portion of the model should be.  There should be a line in the shadow where the model ends.

And yes, the settings I mean are the transparency blending ones.  I worked through each change one by one and it wasn't untill I checked the framebuffer box that the problem occured (which unfortunatly is also the point the blending works) I need to check if ticking the box without the other settings will trigger it, as there might be another combination that provides the right results.

SimFox

Oh, yeah!! I see it now...

How did I miss it?!?!


anywho, I see the problem now. But luckily it is a really minor one. I don't see really much use of transparent flat low models...
BTW is that model a building or prop, is there any difference?

Diggis

That model was a prop, and I have some stream banks that use transparency blending to create a nice edge which would be nice with shadows.  Which is how I found the problem.  :'(

http://sc4devotion.com/forums/index.php?topic=5068.msg240291#msg240291

SimFox

Oh, I see... that's really suck! It would have bee really neat application...

Diggis

Yeah, still going to push on with the models regardless, but will look into the transparency setting and see if there is anything that can fix it.

SimFox

I'll try my best. I really think it is a very worth cause...
I'm very busy at the moment but will be freer in a week or so...
btw are you making it like Nam puzzle pieces?

Ennedi

#27
Shaun, I think your problem is a part of a larger theme:
- How does the game work with layers ie. how does it cover one texture by another - especially if one or both textures are alpha-blended?

1. You have a problem with shadows on the semitransparent prop. But such props are used in SC4. These are various kinds of Transparent Ploppable Water.
I tested JRJ TPW, Chrisadams TPW and the new David's (Dedgren) Ploppable Water large lots. I was curious how shadows look on these lots - nobody announce any problem with them till now.

Jeronij's TPW:


Chrisadams' TPW (shadows are less visible because of the water texture, but they work well in this case too):


And David's TPW


All these lots have one feature which is similar for all TPW lots but different from your lot: this is the model height.
- All TPW models are from 2 to 4 meters high. (That's an interesting information, especially when we compare it with the critical height of the "normal" ie. opaque model described earlier in this thread, which is equal to 0,3 m  :))
- Your model is 0,0 m high.

I'm rather sure that the height is the critical factor here. Why?
When Jeronij created his TPW, I tried to create a smooth transition between the ploppable and game water. I knew that it is quite easy with an old opaque ploppable water, because it can be placed at the sea bottom and it is covered by water depending on it's transparency at various depths. So we can make a smooth trasition simply placing the ploppable water at the sea bottom.

But when I tried to do the same with the new TPW, I found a strange thing: The Transparent Ploppable Water is visible when we plop it on the sea bottom only if the sea depth is less the the TPW model height.

Jeronij's TPW is 4 meters high (deep?  :)). Here the sea is 0,7 m deep (look at the y value in the Terrain Query, the sea level is 250,0 m and here we have 249,3 m)


Here the sea is 4 meters deep (exactly the same as the TPW height - lots are still visible)


On the third picture the sea is only a bit (0,1 m) deeper. TPW lots are present here (as the query shows), but they are invisible.


So I wasn't able to make a transition between the TPW and the sea water. I hhad the same idea a Shaun ie. I tried to experiment with transparency. My way of thinking was:
- Maybe the TPW is invisible because its minimum alpha value is higher than alpha value for TPW?
So I decreased the minimum alpha valu for ingame water to 0. But it didn't make the TPW visible.

You can say that my experiments with the TPW and water are a different story. But I think both Shaun's and my problems have something common - both are connected with the model height, and the model height is connected with covering layers one by another. Its not a theory, it's rather guessing.

What would I suggest?
- Make your model more than 0,3 m high and see what will happen. If you will still have a problem, make it 2 m high (we know that TPW works well with shadows at that height, maybe there is another critical value?)

PS. After writing it I remembered something: some time ago MAS71 tried to make a canal/sea transition for his JRP canal lots. He made 1x4 overhanging lots with an alpha gradient. The model height was 0, exactly as in Shaun's lot. I decided to check shadows on this lot. And here is the result  :D



These lots were dedicated to place under water, so shadows weren't important for our Japanese friend. I suppose he even didn't check it.
But I think this experiment confirms my hypothesis, or at least makes it a bit more probable  :)

Adam

Edit: If my hypothesis is right, it can lead us to another interesting theme: we can check what will happen if we decrease the TPW model height below 0,3 m? Maybe it will become visible under water at the bigger depth too? It would solve the TPW/sea transition problem!  :)
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

SimFox

Ennedi, I'm sorry I can't quite follow your deductions all the way...
I'm also not familiar with all the intricacies of the TPW design. But as far as hight of the LODs concerned I have some thoughts.

First of all it's important to make a distinction between the Model and LOD. Well, this is important to me as I always start thinking as a modeler not a moder.
Model is the actual meaningful geometry in the modeling software  be it GMAX or MAX. LOD is, well LOD. And, yes, I dop know that it serves as a model inside of game. But this dichotomy opens some interesting possibilities - model in some cases may be much taller than actual LOD. It doesn't always need to be contained withing it in all 3 axi. Enough conditions is taht it fully projects on teh LOD shell from the camera point of view. Saying that it is importatnto remember that view angle of different cameras is different and preview should be made for all of them.

Anyway, to the matter at hand. As much as I grasp it the issue with TPW isn't quite the same as with the, say, roundabout fillers or Shaun's work. You see, incase of TPW there isn't really any shadow ON it. What you see is a shadow of the object on the ground UNDER the water. So effectivelly you don't see shadow ON the water but you see it THROUGH the water.
Taking this fact into account you see that this isn't really a matter of LOD shell hight. Well with one important exception  when the Shell hight is 0 many weird things may happen. Since the game is in fact 3d environment, albeit a very primitive one situation known as Coplanarism (existence of coplanar elements) arise. Two separate element occupy exactly same spot leaving 3d engine wondering which one should be displayed. In this case the question is NOT of how to blend them. All blending method assume that something is over or under. To sort of safeguard against this event engine may have some sort of rule which ONE to display. what those rules may be in case of SC4 still needs to be looked into.

I believe to solve this problem we have to look at how transparency is used in game. From the top of my head I can think of two applications - shadows and game water. Looking at how each is functioning can provide a clue.



Ennedi

Simfox,
I'm not a modeler but all your explanation sounds logical and even obvious in the main points.

Quote from: SimFox on May 09, 2009, 01:05:48 AM
(...)
Anyway, to the matter at hand. As much as I grasp it the issue with TPW isn't quite the same as with the, say, roundabout fillers or Shaun's work. You see, incase of TPW there isn't really any shadow ON it. What you see is a shadow of the object on the ground UNDER the water. So effectivelly you don't see shadow ON the water but you see it THROUGH the water.
(...)

I think exactly the same. But in this case increasing the model height looks like a good advice, isn't it?  ;)
Looking at your arguments I think it would be good to check both cases ie. the model height above and below 0,3 m (but not 0). Results could give us an additional information.

Quote from: SimFox on May 09, 2009, 01:05:48 AM
(...)
I believe to solve this problem we have to look at how transparency is used in game. From the top of my head I can think of two applications - shadows and game water. Looking at how each is functioning can provide a clue.
(...)

Very good, but what should we do to research the transparency? Which experiments could be made?

Adam
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

jeronij

#30
Quote from: Diggis on May 08, 2009, 04:33:46 AM
Yeah, still going to push on with the models regardless, but will look into the transparency setting and see if there is anything that can fix it.

Regarding Shaun's issue, I hope this may help somehow : http://sc4devotion.com/forums/index.php?topic=7813.msg244976#msg244976

;)

Regarding the way the game handles transparency, I think this is a very interesting discussion, because I worked "blinded" somehow when I made the TPW, and I went to the final result using the old try and fail empirical method, so much time consuming....  ::) ... the more knowledge we can have about the game's mechanics, the best for all  :thumbsup:
I am currently not active - Please, contact Tarkus for any site related matter. Thanks for enjoying SC4D :D


Autism Awareness;  A Father Shares
Mallorca My Mayor Diary


Diggis

Adam,  I've had a quick read through your comments and will read them more in depth when I get a chance.  The thing that stands out is that the TPW is a constant opacity, where as my model has a gradient opacity.  Idealy I would like the shadow to show on the model where it is solid, and the ground where it shows through.  A little much to ask possibly :(

JrJ, thanks for the link, I'll take a look at that when I can.