Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,403 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: real-time constructive solid geometry [Re: MikeS] #304605
01/09/10 06:26
01/09/10 06:26
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40

Foxfire,Thank for that,I will be glad to do that.But i dont like msn i use yahoo instead.

we can colaborate (the 3 of us) to figure out a working implementation in GS.Its good idea to do that. I am waiting for you Foxfire and CItrok wink

I found that my approach may not work when knife(B) is completely inside base(A). in this case wrong results may appear.Some other cases that wrong results appear :
1- when we handle concave-shaped models (as both knife and base)
2- when the camera (eye) is inside either base or knife (which cause the stencil buffer to completely filed)

It has some shadowing and collission detection knot. So for now it is not practical unless we work on it to figure it out.


every body got some dues in life to pay
Re: real-time constructive solid geometry [Re: DR_Black] #304607
01/09/10 07:16
01/09/10 07:16
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
I think this approach is better:
As always we have to objects(models) on to be subtracted(A) we call this "base" and one to be knife(B) we do following :
1-Render A (base) using a depth map generator shader (simple camera-space Z > pixel brightness) and store result in a buffer for example "bdm" (stand for base depth map)
2-Render B same way and store result to a buffer named "kdm" (stands for knife depth map)
3- Do this :

for each bpx as pixel in bdm //for each pixel in base depth map
for each kpx as pixel in knm //for each pixel in knife depth map
if bpx == kpx //if the depth is equal
fill same pixel in stencil buffer
end
end
end

Now stencil buffer contains area where surfaces of A and B are overlaping

4-Render B with flipped normals using stencil buffer on screen
5-Invert stencil buffer
6-Render A using stencil buffer on screen
7-end

It seems it works better when base is a flat surface and knife is convex-shaped for example it can used for bullet hole ,so on. Any idea?

For collission : Every time C (third object) collides with A(base) and NOT collides whit B(knife) it (C) collides the way we want

For shadownig : I have no idea. wink


every body got some dues in life to pay
Re: real-time constructive solid geometry [Re: DR_Black] #304612
01/09/10 08:54
01/09/10 08:54
Joined: Jan 2010
Posts: 145
Doc_Savage Offline
Member
Doc_Savage  Offline
Member

Joined: Jan 2010
Posts: 145
i think i might have a helpful resource. look up Red Faction's Geo-Mod Technology, Red Faction is the game i started my hobby as a Game Artist.


Do not concern yourself with my race, personality or origin. find my record in the pits, and then make your wager.
Re: real-time constructive solid geometry [Re: Doc_Savage] #304697
01/10/10 08:15
01/10/10 08:15
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
Is there any shader guy who can implement this?


every body got some dues in life to pay
Re: real-time constructive solid geometry [Re: DR_Black] #304700
01/10/10 09:08
01/10/10 09:08
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
I dont think 3DGS support realtime primitive instancing/creation.
You still can do it using C++ I guess, using directX interface, but it's beyond my knowledge...

There's another option, with Pixel Shader 3.0 Geometry Shader, but I dont know if 3DGS support that too...

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1