One question about shadows. I have one directional light in my scene, and it is configured as “stationary”. I have many objects, that can cast shadows. Scene is look like this:
GPU Profiler shows that a lot of time spent in the shadow casting. Every object take 0.1-0.2 ms for casting shadow.
Is it normal situation? Is there way to optimize shadow casting? I repeat I have only one light source. By the way, I have disabled Preshadows. Don’t understand what is this, but it takes too many time too
Questions: Is this for sunlight? Does the sun move during gameplay? One idea is to include the shadow as a part of the game piece, with a pre-baked, translucent shadow on an alpha-textured “******-like” base around the bottom of the model. One drawback would be this would not cast shadows on neighboring pieces, though if the sunlight were in a more “high-noon” position, this would become less of an issue…
Why would the word, “******” be censored?? Okay, clearly this means something else to someone in charge here, so I’ll post a picture of what I’m referring to:
Btw, “Pre-Shadows” refers, I believe, to the process of computing shadows ahead of time & baking them into the textures, which is usually only helpful for environments. It’s much akin to what I’m suggesting. So, to expand, here’s some tips about how to implement what I suggest:
In your model viewer, position the model as though you’re looking down on it from the direction of the sun. (Tip: Do this using repeatable keyboard commands for the sake of consistency!) Turn off the material, & dhow the model with flat shading, (white on black, for example.) Take a screen-shot, & bring it into GIMP or Photoshop. Edit this image into your texture map for the model’s material, being sure to include it as the alpha-channel.
Next, add a flat square faces around the bottom of your model, sitting just above the ground. Add the texture you just created to this square.
That’s the basic idea. Instead of computing these shadows every frame, you’ve got a pre-baked shadow for that piece all ready to go.
Thanks for answer! But yes, sun can move. It is static only on level, but between levels direction can change. For example, one level is sunny day, next level is cloudy evening. So I can’t use prerender shadows. I can use prerender decal shadows only for characters
Is there way to change shadow’s technics? Or disable receiving shadows for some objects? Or I do something wrong? Just I look on StarCraft 2, and there are hundreds objects and they all cast dynamic shadows and all looks fine and fast.
Weird… No idea what the word is since when I try to view it, it won’t show me. Can you PM me the word and I’ll bring it up with Epic Staff so somebody can look into it? Just separate the letters if you have to.
Use a movable directional light with cascaded shadow maps. That way it only renders one shadow map (or few, depending on the number of cascades) which in turn means you don’t get the overhead of per object shadows as you see in your GPU profiler.
Try setting the cascade count to 1 to see if it helps resolution. Since you have a top down camera it doesn’t make any sense to use cascaded shadow maps that vary the cascade resolution based on scene depth. If the camera is far enough away, using the most high-res cascade for basically nothing.
I’ve taken “Flange” out of the censored words filter. It was in there by default (we made our list with a lot of pre-built stuff) and it is considered an insult in some places. It’s unfortunate that there is not an “intent” or “context” filter for so many of these common words that are also used as insults.