shadow mesh vertex alpha probem

Blitz3D Forums/Blitz3D Programming/shadow mesh vertex alpha probem

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

ok I see. There are some problems with some cards when mixing alpha and additional blending. see versions.txt about the reimplementation of the feature to mix them at all.

It doesn't matter if it's vertex alpha, texture alpha, entityalpha, basicly it's alpha with all its troubles (z-sort, the mentioned mixing problem)

I think you seriously need to use an other shadow blend mode. IMHO there's no need for blendmode 2. I suggest to do it this way: Blendmode default, 1(alpha). Use a texture that is completely black on the RGB channel and has the shape of the shadow tored in the alpha channel only. You may use Photoshop to do such a shadow. Save as TGA 32 Bit.

Alternatilvely do it this way: (Assuming your shadow texture is dark shadow on bright "background")

tex=loadtexture("shade.bmp")
setbuffer texturebuffer(tex)
lockbuffer()
for j=0 to textureheight(tex)-1
 for i=0 to texturewidth(tex)-1
  rgb=readpixelfast(i,j) and $FFFFFF
  grey=int (255.0-(((rgb shr 16)+((rgb shr 8) and $FF) + (rgb and $FF))/3.0)) shl 24
  writepixelfast i,j,grey
 next
next
unlockbuffer()


Not sure if it works, just typed it. What it does: inverting the brightness, so black will be white and white will be black, then it will shift the brightness to the alpha channel and paint the RGB channels black.

when you use med. grey on white, it should look about nice.