POV-Ray : Newsgroups : povray.pov4.discussion.general : Feature proposition: syntax for custom reflections : Feature proposition: syntax for custom reflections Server Time
28 Apr 2024 14:11:18 EDT (-0400)
  Feature proposition: syntax for custom reflections  
From: Hymyly
Date: 25 Feb 2008 11:50:01
Message: <web.47c2f067b27c2bcd63108fea0@news.povray.org>
Hi everyone!

<rambling>
It seems to me that one of the main recurring feature requests in the POV-ray
groups has to do with the lighting model. Some want to include Bi-directional
Reflection Distribution Functions (BRDFs) to simulate accurately things like
diffuse reflections and anisotropic surfaces. Others think things like that
would bloat POV-ray without adding any really useful functionality.

What strikes me though is that we have yet to see someone proposing _how_ such
features could be implemented, rather than just saying "we should have it" or
"it's impossible". This is what I am trying to do.

First of all, I think that the lighting model used by POV-ray is excellent. It
has been in use for well over a decade, and can easily last one more.
Eventually however, the current lighting model will be obsolete, and the sooner
we start introducing a new one the better. This feature does however not have
that much to do with the lighting model. Backwards compatibility comes before
awesomeness.
</rambling>

What I propose is the following. It is subject to alteration.

A keyword such as "adv_reflection" be introduced into the finish-block. This
keyword can be used to shoot rays. Normally when a ray hits an object, two rays
can be shot away, the reflected and the refracted; both these rays follow the
laws of physics. The adv_reflection keyword will allow you to specify
additional rays to be shot, possibly hundreds or thousands (you know, if you
happen to have HAL 9000 in your basement).

The direction, intensity, and even origin of the additional rays are completely
customisable. This feature could therefore be used to create portal-looking
objects, by shooting a ray out of object B when a ray hits object A. You could
also use it to create retroreflectors, and all kinds of cool stuff.

The syntax I propose is that within the adv_reflection block should be three
blocks:

1. origin
2. direction
3. intensity

If any of these are omitted, POV-ray should default that particular block. If
all blocks are omitted, adv_reflection should behave like regular transparency.

Within these blocks the location where the ray hit, the surface normal at that
point, etc, should stored into some keyword, such as "origin" and "normal"
perhaps. You then write an expression using these keywords.

Exactly how intensity should work together with conserve_energy, I haven't got a
clue. Yet.

====And the grand finale for all of you BRDF-freaks out there:====

If you use a random function within any of the blocks above, you will get
different rays coming out from each hit. Also, the entire adv_reflection block
should have a "count" parameter, specifying how many rays are shot at each hit.
This way, true anisotropic or diffuse reflection (and refraction for that
matter) can be simulated.

I don't expect this just to get plugged into POV-ray exactly as I have described
it, and your input is very valuable - developers and noobs alike.

Hymyly.
And there was light.


Post a reply to this message

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