1
$\begingroup$

I need to use a variance buffer shadow sunlamp to illuminate a scene in the game engine yet I have not succeed in obtaining correct shadows from my alpha planes as you can see in this picture. Is it possible ? enter image description here

here's the blend

$\endgroup$
1
$\begingroup$

Variance lights do not support alpha channel. I'm not sure why. Simple shadows do (as pointed out in one of the other answers), but as you have discovered, variance shadows do not.

To enhance the effect of a bigger shadow area, you can vertex-parent the sun to the player, so it follows them around. This way you can get a 512x512 shadow map to appear to cover the entire map.

Sorry I can't be of any further help.

$\endgroup$
0
$\begingroup$

Under the game settings tab located in the material editor enable Alpha blend If this does not work try using a Hemi light source instead of a sun lamp.

enter image description here

$\endgroup$
2
  • $\begingroup$ I tried with every kind of alpha it won't fix the situation, hemi doesn't produce buffer shadows, only sun and spot do. $\endgroup$
    – Yvain
    Mar 17 '16 at 12:30
  • 1
    $\begingroup$ Maybe you could include a .blend file. It makes it a lot easier for people to help solve the problem. $\endgroup$
    – Delagone
    Mar 17 '16 at 12:59
0
$\begingroup$

If you are looking for what is in the image you have posted, then bumping up the sun value to 6000 gave me this:

enter image description here

Otherwise: my understanding of your intent, is that you wanted the shadows to match the shape of the Leaves, like the following image.

enter image description here

The biggest for me was to do two primary things:

  1. Make sure that my Leaves had a true Alpha Channel (not just Black to Alpha)

  2. Changing shadow type from Variance to Simple on the Sun Lamp.

Note In the viewport this does not work, but in game it works.

Here's the blend so you can cruise around and match any settings I messed with, just in case I missed something, plus I also packed my horrible version of a leaf texture image in here for you to make sure you have a visual reference to understand what I mean regarding the Alpha Channel.

$\endgroup$
3
  • $\begingroup$ your shadows here are well but they are emited from a simple buffer shadow lamp and I wanted to be able to use the variance buffer for that purpose because when you are working on big scale with 1000 trees you need a resolution buffer that is not affordable to produce correct shadows in real time, so I was hoping I could trick the result by having lower resolution shadows but still the effect of gradient you get with variance lamp. $\endgroup$
    – Yvain
    Mar 23 '16 at 18:13
  • $\begingroup$ So is the image that you posted your desired result or your problem? $\endgroup$
    – Rick Riggs
    Mar 23 '16 at 18:17
  • $\begingroup$ @Yvain, I modified my answer to address both cases anyway. $\endgroup$
    – Rick Riggs
    Mar 23 '16 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.