HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Question about shadow casting  (Read 2427 times)

Anubisan

  • World Owner
  • ****
  • Posts: 5
    • View Profile
[Resolved] Question about shadow casting
« on: Jan 05, 12, 05:15:41 PM »

Hello all!

I apologize if this has been posted elsewhere, but I was not able to find a solution to my problem when I searched the forum. We have begun importing a large number of models into our game and have encountered a frustrating problem involving shadows on models with materials using alpha. It seems that any objects we add with alpha will not display shadows from that material. I'm sure the solution to this is obvious, but I am still very new to the engine and this is driving me crazy.

Please look at the attached image for an example of what I mean. The tree models shown in the image are the same model. One has alpha on the leaf material while the other does not. The one with alpha is casting no shadow, while the other obviously is.

Any help would be greatly appreciated!

« Last Edit: Oct 26, 12, 03:41:37 PM by HE-Cooper »
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Question about shadow casting
« Reply #1 on: Jan 05, 12, 05:19:24 PM »

Thus, why we provide the mighty SpeedTree!
Logged

Anubisan

  • World Owner
  • ****
  • Posts: 5
    • View Profile
Re: Question about shadow casting
« Reply #2 on: Jan 05, 12, 05:21:37 PM »

We do intend to use SpeedTree, but we also have a bunch of tree art assets already that we would like to use if possible. Is there any workaround to this issue or am I up a creek?
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Question about shadow casting
« Reply #3 on: Jan 05, 12, 05:29:13 PM »

Well, the shadows would never cast based on "textures" as that would be incredibly complicated to and intensive.
But i actually don't know if we should be casting shadows based on those meshes, despite the texture being alphad.

That I am in fact, currently looking into. Which would obviously be a better outcome for you than no shadows.
Logged

Anubisan

  • World Owner
  • ****
  • Posts: 5
    • View Profile
Re: Question about shadow casting
« Reply #4 on: Jan 05, 12, 05:37:57 PM »

Thanks for your help.

In the meantime, I suppose I should familiarize myself with the mighty speedtree.  ;D
Logged

HE-HERB

  • HeroEngine
  • *****
  • Posts: 530
    • View Profile
    • HeroEngine
Re: Question about shadow casting
« Reply #5 on: Jan 05, 12, 08:15:15 PM »

I'm going to guess that the tree on the right uses alpha-blending (instead of alpha test / mask, or no alpha)?

Alpha-blended textures force objects to be sort dependent, which means they are rendered after the scene, and, therefore they can't cast shadows.

This isn't a HeroEngine issue, this is a standard, "how modern graphics depth buffers work" issue.

Assuming that's the case, change the texture format, or use SpeedTree

Cheers
Logged
herb marselas
graphics guy

damented

  • Developers
  • *
  • Posts: 2
    • View Profile
Re: [Resolved] Question about shadow casting
« Reply #6 on: Jan 13, 13, 02:29:09 PM »

I am having a similar issue with our trees. I created a sample speedtree through it in the game placed several, none of them cast any shadows. Players and buildings i added are casting shadows, is there a setting in the speedtree config i am missing to be able to cast shadows?

Thanks,
Josh
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: [Resolved] Question about shadow casting
« Reply #7 on: Jan 13, 13, 02:43:15 PM »

open properties panel, change setting for cast shadows to true :-)
Logged

damented

  • Developers
  • *
  • Posts: 2
    • View Profile
Re: [Resolved] Question about shadow casting
« Reply #8 on: Jan 13, 13, 02:45:31 PM »

Thanks, just found that in another post.

Logged

Irushian

  • General Accounts
  • *
  • Posts: 44
    • View Profile
Re: [Resolved] Question about shadow casting
« Reply #9 on: Jan 13, 13, 02:59:50 PM »

open properties panel, change setting for cast shadows to true :-)

Setting CastsShadows to true doesn't have an affect within HeroBlade (Tested in a play instance within a clean area), unless there's a missed setting within SpeedTree (or the compiler) itself?
Logged

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: [Resolved] Question about shadow casting
« Reply #10 on: Jan 13, 13, 03:02:22 PM »

Select the tree, open the properties panel, and enable shadow casting on the tree.

Have you enabled shadow casting in the render panel for all assets?
Logged

Irushian

  • General Accounts
  • *
  • Posts: 44
    • View Profile
Re: [Resolved] Question about shadow casting
« Reply #11 on: Jan 13, 13, 03:21:03 PM »

Have you enabled shadow casting in the render panel for all assets?

Ah, Directional Shadows was disabled, thank you.
Logged