POV-Ray : Newsgroups : povray.general : Vertex / fragment shader programs... Server Time: 22 Oct 2017 21:07:10 GMT
  Vertex / fragment shader programs... (Message 1 to 3 of 3)  
From: Heriberto Delgado
Subject: Vertex / fragment shader programs...
Date: 3 May 2017 21:40:01
Message: <web.590a4dc1e4431114498b4c860@news.povray.org>
Hello everyone!

I'm entirely new to POV-Ray, apologies if this sounds like something only a
complete newbie would ask.

Does POV-Ray possess something akin to vertex / fragment shaders, as in small
programs able to preprocess vertex input for polygon meshes, as well as
modifying color information for each pixel ("fragment") captured from the scene,
as seen in GPU-based video adapter hardware nowadays?


Post a reply to this message

From: clipka
Subject: Re: Vertex / fragment shader programs...
Date: 4 May 2017 13:16:03
Message: <590b2993$1@news.povray.org>
Am 03.05.2017 um 23:38 schrieb Heriberto Delgado:
> Hello everyone!
> 
> I'm entirely new to POV-Ray, apologies if this sounds like something only a
> complete newbie would ask.
> 
> Does POV-Ray possess something akin to vertex / fragment shaders, as in small
> programs able to preprocess vertex input for polygon meshes, as well as
> modifying color information for each pixel ("fragment") captured from the scene,
> as seen in GPU-based video adapter hardware nowadays?

Vetex shaders: No; POV-Ray currently does not provide any means to
manipulate mesh vertices.

The primary reason has its root in the fact that POV-Ray is not your
run-of-the-mill mesh-focused render engine, but is based around
geometric primitives (spheres, cylinders, boxes, etc) and constructive
solid geometry. Mesh support had only been added as an afterthought, and
is therefore not as feature-laden as in render engines where meshes are
the only geometric constructs at your disposal.

Fragment shaders: No; POV-Ray uses an entirely different rendering
approach (ray tracing) than most contemporary render engines (mesh
rasterization), and therefore there is no such thing as a "fragment" in
POV-Ray. (Note that in OpenGL terms, a "fragment" does not correspond to
an individual pixel; instead, it corresponds to a pixel-sized section of
an individual mesh triangle. For example, a pixel straddling the edge
between two triangles will correspond to two fragments.)

If, instead of genuine fragment shaders, what you really want is just
"modifying color information for each pixel" of the entire scene, i.e.
per-pixel postprocessing, then: No, not yet; work has started on such a
feature though, and an experimental implementation does already exist in
the "feature/tonemapping" branch on our GitHub repository.


Post a reply to this message

From: Benjamin Chambers
Subject: Re: Vertex / fragment shader programs...
Date: 4 May 2017 22:01:33
Message: <590ba4bd$1@news.povray.org>
On 5/3/2017 3:38 PM, Heriberto Delgado wrote:
> Hello everyone!
>
> I'm entirely new to POV-Ray, apologies if this sounds like something only a
> complete newbie would ask.
>
> Does POV-Ray possess something akin to vertex / fragment shaders, as in small
> programs able to preprocess vertex input for polygon meshes,

Not exactly, but in the past I wrote a POV macro that would read the 
text of a mesh file, manipulate the mesh, and then build it within POV 
(I was doing tessellation at the time, but with this method you could do 
pretty much anything a vertex shader could do).

> as well as
> modifying color information for each pixel ("fragment") captured from the scene,
> as seen in GPU-based video adapter hardware nowadays?

Again not exactly, however POV-Ray possesses a very sophisticated 
texturing system that allows you to define procedural textures for your 
objects.

You might get a better answer if you told us what ends you wish to 
achieve, rather than asking what tools are available, and we'll let you 
know how to accomplish it with POV.


Post a reply to this message

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