POV-Ray : Newsgroups : povray.off-topic : Geometric puzzle : Re: Geometric puzzle Server Time
8 Oct 2024 17:26:36 EDT (-0400)
  Re: Geometric puzzle  
From: scott
Date: 18 Dec 2009 03:09:11
Message: <4b2b38a7$1@news.povray.org>
>> That method has problems when you are drawing triangles adjacent to each 
>> other.
>
> Like what?

Well draw your first filled triangle with your algorithm, and down the edges 
I presume most pixels will have some fractional coverage.  So if the 
coverage for a particular pixel is say 25%, I assume you take 25% of the 
triangle colour and blend it with 75% of the existing background colour. 
All looks very nice and perfectly AA'd.

Now draw the next one that is supposed to share one of the edges as the 
first triangle, this time that one particular pixel will have 75% coverage, 
so you take 75% of the triangle colour and 25% of the background colour 
(which is actually 75% of the original background and 25% of the first 
triangle).  Oops - the background will be showing through along the edge.

I guess you could get around it by only doing the AA algorithm on edges that 
aren't shared (after the back-face cull step), but typically the graphics 
card doesn't know this information while it's rendering.

>> Also how does your method work with a pixel shader?
>
> If I actually knew what a pixel shader is, I could maybe answer. :-)

The pixel shader is the code that gets called on the GPU to calculate the 
pixel value.  It will be passed various bits of information like the world 
coordinates, screen coordinates, lighting vectors etc.  Should the GPU still 
pass the coordinates of the *centre* of the pixel, even if only 25% of one 
corner is actually being covered?  Or is it more correct to pass the 
coordinates of the centre of the sub-pixel area that is being shaded?  IDK.

> Unless it's a particle method.

You mean to be rendered as a fluid?  You can't just raytrace particles 
directly either, you need some algorithm to make it look like a fluid.  I 
suspect algorithms exist for raytracing particles as a fluid (blobs?) and 
also for creating meshes from particles.  Anyway, people don't place the 
triangles by hand.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.