POV-Ray : Newsgroups : povray.binaries.images : Basic SDL raymarcher : Re: Basic SDL raymarcher Server Time
5 Nov 2024 16:41:09 EST (-0500)
  Re: Basic SDL raymarcher  
From: Samuel B 
Date: 10 Aug 2023 16:55:00
Message: <web.64d54d86884abba8f8c47d526e741498@news.povray.org>
"ingo" <nomail@nomail> wrote:
> Sam,
>
> Can't you use the trace function for intersection testing an getting the normal?
> Only had a swift look at the code.

Hi ingo,

I could cheat, sure, but this is a raymarcher. It's an entirely different type
of rendering engine. To put it succinctly: it traces isosurfaces. It can't trace
any standard POV object directly because it only evaluates a function (signed
distance field/function, to be precise). That is why the ray has to step through
the scene; it can't know when it has hit something until it actually gets there.
(Believe it or not, but this method is actually faster when rendering certain
complex objects when using a GPU [if you have a GPU, check out shadertoy.com].
Things like 3D fractals can be rendered in real time, whereas in POV-Ray they
can take hours)

This scene is a test case: can it be done in POV-Ray? The answer is yes it
can... But this particular method is very inefficient.

> I.i.r.c. there was some patch that also returned the colour at the intersection
> point.

That could be done here too, since it's possible to obtain the value of a
pattern function after the ray has hit something. But any lighting here is
"virtual." I use no actual light_sources; they must be defined another way.

> Brain's getting more fuzzy than I'd like to.

I know what you mean, somewhat. I go through periods of extreme mental
tiredness, and I tend to forget a lot of things. Even the names of people I went
to school with. Or events that happened and /should/ remember, but I don't. (I
don't think it's dementia or anything... I think it's just the extreme changes
my brain goes through periodically.)

> Just posted a recent inc that traces objects or patterns to an inc file with
> array's <web.64d47ced807074f217bac71e8ffb8ce3@news.povray.org>
>
> ingo

Hm, I'll have to check that out. Based on the description, it makes rounded
shapes from sharp-edged objects (such as text)? I won't really know until I run
it, I guess :D

Sam


Post a reply to this message

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