One more pseudo-stencilShadow code ...

Blitz3D Forums/Blitz3D Programming/One more pseudo-stencilShadow code ...

Paolo(Posted 2005) [#1]
This is similar to the first demo we saw
using stencil shadows, but this time it is
completely done with Blitz functions and
it only require two RenderWorld()'s.

I would like to hear if someone get an idea...
I think this might be useful for casting simple
pre-made shadow volume onto geometry ...

Read the comments, they are pretty simple:




jfk EO-11110(Posted 2005) [#2]
This is great. I wonder if it's hard to create shadow volumes on the fly for any mesh, including animated ones. Maybe there is some kind of formula that takes the light-to-mesh relation pitch/yaw and roll and returns the required scaling factors for the meshes copy that will be the basement for the shadow volume?

I really like this method since it's using only built in commands.

EDIT: I think you need to scale (stretch) the meshes on the vertex level, so you can move the vertices contrary the lights direction. Begin with the vertex that is closest to the light, this one has to stay where it is. all other vertices should be moved away from the light, depending on their distance to the meshes center. However, this requires realtime mesh deformation and may be pretty slow.


John Blackledge(Posted 2005) [#3]
It has possibilities, but if you put a sphere where the light is (and stand under the sphere) you can see that there are shadows beginning generated that shouldn't be.(?)


Braincell(Posted 2005) [#4]
jfk,

where have you been? This is pretty old.
fredborg recently showed a demo on these forums, didnt you see it? Its still here somewhere. It is possible to make shadows for unanimated meshes because you need vertex positions and you cant get that for animated meshes.


John Blackledge(Posted 2005) [#5]
Lenn, where have _you_ been?

Can you read the other shadow thread on the Showcase and (pretty please) let us know where you're up to.


big10p(Posted 2005) [#6]
All I see is this:


...which doesn't look right at all, to me. What is supposed to be casting that shadow?


puki(Posted 2005) [#7]
Well, there is no object shadow casting as such - still, it is an interesting idea. It just doesn't work in its current format. So, as the author says, simple shadow stuff.

An interesting idea though.


jfk EO-11110(Posted 2005) [#8]
Lenn - didn't realize this is the same method fredborg used in his demo. I know it, and I already realized that it has the same problem, the shadows will be visible on both sides, on the sunny side and on the shady side of the object. Tho I didn't realize it's the same method. The thing that I found fascinating is the fact that the intersection can be used as a 2D shadow thing.


Paolo(Posted 2005) [#9]
I have been trying to get something with this but
I can not go any longer ... there is just too many problems
to resolve ...
... anyway, I think I can live with no-shadow-stuff for me :)

Paolo.


Braincell(Posted 2005) [#10]
jfk, this isnt the same method as real stencil shadows. This is just pseud-stencil like he says, he isnt using the stencil buffer and other DirectX stuff. This is just the same concept which in software would always be kinda slow.

Btw, i replied in fredborg's thread and i intend to finish the free stencil shadow system. So eurythmia, you might end up having shadows after all... if i get it all to work like i want it to.

Also, yes stencil shadows will always be visible "on both sides". This is just the nature of the shadow system and in many games it is completely ignored, such as Neverwinter Nights. In doom3 they just didnt make surfaces that you could see the other side of, or if they made some sort of culling method i cant imagine a simple way to do it with a limited (high level) blitz command set... This problem can easily be avoided with careful placement and scene design.


Paolo(Posted 2005) [#11]
Lenn,
yep, I was trying to get something using blitz functions only ...
so anyway ... I hope you get to a good point with that system :)


Red Ocktober(Posted 2005) [#12]
hey Paolo... a quick 3DRAD (hahaha, do you remember back that far:) ) question...

you did some multiplayer stuff with it... do you remember any reason why it might not want to allow more than 2 people to link up via multiplayer?

everytime i try to get 3 or more, the 3rd player winds up messing up the host...

it all works fine over a LAN, but the net is the where the problem comes in...

do you need ipx over the internet as if tcp is being used?

sorry about this... thanks...

--Mike


Paolo(Posted 2005) [#13]
hi Mike !

Honestly now I have forgotten most of how to program
in 3DRad, I think you might be talking about Virtual Gotcha, I remember we used to test the game over
the net with 3 players and it did was working at that time, although when the game was "released" John Robin
told me there was big problems with more than 3 players...
I don't know what can be the problem by these days :(
... it is also strange the game works good over a Lan but
not over the net, I can only think about it might be something RAD-relative ...
...and I don't think we were using ipx, only TCP ...

Cheers!
Paolo.


Red Ocktober(Posted 2005) [#14]
thx Paolo... d3@1m RAD :)

how's Tecno coming along...

--Mike


Paolo(Posted 2005) [#15]
I'm quite happy about how the game is coming,
although is some kind of disappointment the so-slow-process to
accomplish something ... you know, if I would have known
3 years ago about the hardness of game development I think
I would have never begun this project ... :)
Anyway the game is coming very good, don't know exactly when
I will finish it but I know for sure that I will finish ... now it has
became a personal challenge :)

I'm always keeping an eye on your posts, but mainly I come
to the forum to read ... don't post too much ... I can't think much in English language !
By the way, are you still thinking about self publishing for the subsim?
the other day I was having a look at Valusoft, it seems they offer a very
good deal, and if your game does well over the net they also offer
store-publishing ... don't know for sure but if they accept Tecno, I think
I will be publishing through them when the time comes ...

Later!
Paolo.


jfk EO-11110(Posted 2005) [#16]
Lenn - i meant an older coder archive entry by Fredborg: http://www.blitzbasic.com/codearcs/codearcs.php?code=1010 not his recent stencil shadow demo.