Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 748 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Calculate object "depth" (pixel based) #445305
09/03/14 03:44
09/03/14 03:44
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I want to calculate or approximate the depth of at least convex objects (concave is a plus) on a per pixel basis, if possible in a multipass object shader (with some Src/ Dest or COLOR2 magic?). 8bit (0..255) accuracy is enough.
I've tried to do this with a separate depth view that renders the models with clockwise culling - which works with a single object - but this approach obviously fails when you have multiple overlapping objects.
Any ideas? Thanks.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Calculate object "depth" (pixel based) [Re: Superku] #446907
11/04/14 15:40
11/04/14 15:40
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
One-time bump.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Calculate object "depth" (pixel based) [Re: Superku] #447349
12/05/14 16:10
12/05/14 16:10
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
It depends much on what you are actually trying to do.

If you want the accumulated depth of the overlapping objects you could render only those objects in another rendertarget clock wise with inverse depth.

Another option might be distance function based raymarching in the pixelshader of the objects, but you would have to figure out the distance functions of your objects then.
http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm

What I like to do when i have very simple shapes is just calculate the depth via ray - plane intersections:


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: Calculate object "depth" (pixel based) [Re: Puppeteer] #447352
12/05/14 16:36
12/05/14 16:36
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thank you for your response. Sadly this does not really help me, though. The screenshot is cool and I have used that technique for some experiments in the past and recently, but I need the actual (approximated) diameter/ thickness/ whatever on a per-pixel-basis of a rather arbitrarily shaped object in a view which renders multiple objects (which are all transparent).
What I thought could work was to render the entity first, ignoring the Z-buffer and writing the depth data using clockwise culling somewhere else, then grab that value in a second pass and use it to calculate the real pixel output on the screen. I couldn't get that to work yet, though. Hard to describe for me, sorry.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  Blink, Hummel, Superku 

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