Car Shadow Help

Blitz3D Forums/Blitz3D Programming/Car Shadow Help

Stevie G(Posted 2003) [#1]
I have a car mesh with 2 surfaces. One surface is the car, the other the shadow (just a quad, 4 vertex's etc..)

At the moment a black, alpha=.25 brush is applied to the shadow surface which is a bit naff!! What I'm trying to do is create a texture which has the detail of the car and paint the surface with it. I'm creating the texture with the inbuilt comand :-

shadow_texture=CreateTexture(64,64)

I'm sure someone has come across this before but what I need is for a color other than black to be transparent when printing the shadow onto my track and for only the black to be visible. I also want it so that the black is alpha'd so it's not so dark.

I know that when you create a texture this way it automatically has alpha=1 and you have to do something like this ** to make black transparent but I want to only see the black parts on screen.

**
For x = 0 To TextureHeight:For y = 0 To TextureWidth
WritePixel x,y,0:Next:Next

Can anyone help??


big10p(Posted 2003) [#2]
I think you actually need to use the 'multiply' blending mode for the shadow - this will basically mean white areas of texture will be transparent and darker (grey) areas will darken what's underneath it. Uh, that's a crap desciption but just look up 'EntityBlend' in the online docs on this site for a proper explanation.

If you're using brushes, you'll need to BrushBlend brush,2 then paint your shadow surface with it.

I guess you have your reasons for creating the shadow texture in-code but doing it that way is going to make it hard to create a shadow with 'soft' edges. Maybe you just want a hard edged shadow, I dunno. :)


Stevie G(Posted 2003) [#3]
I tried you method big 10p but even when I user color 255,255,255 and draw a rect over the whole texture initially before applying the darker colours, the white still appears, albeit less visible than the darker shades.

It could be something to do with me then applying alpha .25 to the surface??

Dr AV - sounds good but I'm not entirely sure how I would do this - have you any code to show me?


Rob Farley(Posted 2003) [#4]
No code, you do it in your 3d modeller to get the top view, then play in art packages to do the rest.


Stevie G(Posted 2003) [#5]
3d modeller Hmmmm - I'm doing everything the hard way just now using createmesh. Just new to the 3d programming game but I'm going to have to get a modeller at some stage - any suggestions for the best (free??) package which can produce b3d compatible meshes?


Rob Farley(Posted 2003) [#6]
Milkshape... not free... but very cheap


big10p(Posted 2003) [#7]

I tried you method big 10p but even when I user color 255,255,255 and draw a rect over the whole texture initially before applying the darker colours, the white still appears, albeit less visible than the darker shades.



Hmmm, I must admit I haven't used this method myself yet and, come to think of it, seem to remember someone having similar probs to you. You could try setting the shadow surface to display full-bright - use BrushFX brush,1 and apply it. That may help. :)


Stevie G(Posted 2003) [#8]
Brush Fx 1 worked a treat - cheers - appreciate the help!!
Heard Milkshape mentioned a few times - will check it out.