POV-Ray : Newsgroups : povray.binaries.images : Inversion Server Time
6 May 2024 11:53:30 EDT (-0400)
  Inversion (Message 11 to 20 of 24)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>
From: Anthony D  Baye
Subject: Re: Inversion
Date: 10 Apr 2016 21:15:01
Message: <web.570af99bc6ebc480fd6b6fe10@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 09.04.2016 um 22:32 schrieb Bald Eagle:
> > clipka <ano### [at] anonymousorg> wrote:
>
> >> What this new incarnation will add is the ability to apply different
> >> tonemapping functions to each colour channel, perform cross-channel
> >> colour maths, and as an extra bonus even use functions that depend on
> >> the screen location.
> >
> > So, this would be analogous to various image processing features and "filters"
> > that a lot of graphics programs have?
> > I find the screen location feature interesting, and am wondering how that will
> > function, and what inspired its development.
>
> "Because we can".
>
> Actually the chain of thought was something like this:
>
<snip>
>
> And that's how the screen coordinates have ended up in the tonemapping
> feature.
>
>
> > I would imagine that various functions could be used to adjust brightness and
> > colour using gradients, concentric-type adjustment such as the cos^4 brightness
> > dropoff typically seen in camera lenses, etc.
> > I guess you could also use one image to map/adjust tones onto/in another kind of
> > like a pigment/texture/image map.
>
> With the x and y screen coordinates available, it should be possible to
> write tonemapping functions that overlay a pattern onto the image (via a
> pattern function); such a pattern could in turn be arbitrarily complex,
> from a simple spherical pattern creating a vignette effect to a complex
> object pattern based on one or more text objects overlaying textual
> information like a singature or frame number.

In the spirit of foresightedness... I'm going to shill for my idea of a plugin
api again.  Because:

1) New functionality should be added by new code, not modification of old,
working code.

2) Adding a plugin to a directory and using dependency injection would be vastly
preferable to recompiling multiple un-official versions.

In fact, I would imagine that large parts of the current codebase could be
abstracted out as plugins (necessary core plugins, perhaps, but plugins)

I would also imagine that this would be a task of more than somewhat Herculean
porportions, so I completely understand resistance.

Unfortunately, I wouldn't know where to begin with such a thing, as I have a
hard time following the patterns in the codebase. (to put it lightly)

*kicks the hornet nest and hides*

Regards,
A.D.B.


Post a reply to this message

From: clipka
Subject: Re: Inversion
Date: 10 Apr 2016 23:36:36
Message: <570b1bc4@news.povray.org>
Am 11.04.2016 um 03:13 schrieb Anthony D. Baye:

> In the spirit of foresightedness... I'm going to shill for my idea of a plugin
> api again.  Because:

Your motion is moot, because:

> 1) New functionality should be added by new code, not modification of old,
> working code.

While that may be true in an ideal world, in reality sometimes (actually
more often than not) new code needs to be hooked up someplace nobody had
ever imagined that code might have to be hooked up there, so plugins are
always more limited than patches.

> 2) Adding a plugin to a directory and using dependency injection would be vastly
> preferable to recompiling multiple un-official versions.

Providing hooks to inject user-defined code wherever suitable is already
on the agenda. Except that there most likely won't be a plugin
directory; instead, such user-defined code would be written in a
next-generation scene description language, compiled to some virtual
machine bytecode, and uiltimately just-in-time-compiled to native code.

> In fact, I would imagine that large parts of the current codebase could be
> abstracted out as plugins (necessary core plugins, perhaps, but plugins)

Not yet.

> I would also imagine that this would be a task of more than somewhat Herculean
> porportions, so I completely understand resistance.

You're perfectly right as far as the proportions are concerned, but
you're off the mark concerning resistance. Herculean work is already
going on in the background.

> Unfortunately, I wouldn't know where to begin with such a thing, as I have a
> hard time following the patterns in the codebase. (to put it lightly)

Don't even try. The current codebase is still far too monolithic to bolt
on any way to inject user code. But we're working on it, slowly but
thoroughly.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Inversion
Date: 11 Apr 2016 02:50:20
Message: <570b492c$1@news.povray.org>
On 10-4-2016 20:30, Jaime Vives Piqueres wrote:
> El 10/04/16 a las 17:10, clipka escribió:
>> But yeah, go out and enjoy the beautiful spring weekend. Desert me.
>> Go ahead and see if I care. ;)
>
>    I'm really curious about that new feature and wanted to test it today,
> but your derivatives example and my broken washing machine kept me busy
> all day... luckily, I could repair the washing machine, and somehow I
> worked out the derivatives example into a functional foam pattern (tough
> I'm still fine-tuning it).
>

What lame excuses! :-)

I am curious about the foam pattern. I have tried some ideas of my own 
yesterday but to no conclusive results.

-- 
Thomas


Post a reply to this message

From: Stephen
Subject: Re: Inversion
Date: 11 Apr 2016 05:32:48
Message: <570b6f40$1@news.povray.org>
On 4/11/2016 7:50 AM, Thomas de Groot wrote:

> I am curious about the foam pattern. I have tried some ideas of my own
> yesterday but to no conclusive results.
>

This is PovRay's - Fermat's Last Theorem

I shall cheer on from the sidelines. And watch with interest.


-- 

Regards
     Stephen


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Inversion
Date: 11 Apr 2016 06:13:36
Message: <570b78d0@news.povray.org>
El 11/04/16 a las 08:50, Thomas de Groot escribió:
> What lame excuses! :-)

    No, really... my back hurts now, as I had to be laying on the ground 
almost 2 hours to remove the obstruction on the drain pump. And my brain 
hurts too, after some more hours fiddling with the derivatives result to 
convert them into an usable pattern.

> I am curious about the foam pattern. I have tried some ideas of my own
> yesterday but to no conclusive results.

    I will publish the code soon, but here it is an extract:


// the derivatives
#declare EPSILON = 1e-4;
#declare 
f1x=function{(f_water(x+EPSILON,y,0)-f_water(x-EPSILON,y,0))/2*EPSILON}
#declare 
f1y=function{(f_water(x,y+EPSILON,0)-f_water(x,y-EPSILON,0))/2*EPSILON}
#declare f2x=function{(f1x(x+EPSILON,y,0)-f1x(x-EPSILON,y,0))/2*EPSILON}
#declare f2y=function{(f1y(x,y+EPSILON,0)-f1y(x,y-EPSILON,0))/2*EPSILON}

// the texture from them
#declare t_ocean=
texture{
    pigment_pattern{
function{select(f2x(x,y,0)+f2y(x,y,0),abs(f2x(x,y,0)+f2y(x,y,0))*1000000000*4,0)}
    }
    texture_map{
      [0.0 t_water]
      [0.1 t_foam]
    }
}

    As you can see, the final pattern using the derivatives is tricky... 
I had to play with EPSILON to find a value suitable for the scale of my 
height_field and the "precision" I wanted. Then used select find the 
negative parts and convert them to positive, and scaling the values up 
because they are extremely small. Don't ask me how the hell I worked 
that out... attached is a first render showing the result. Still not 
what I want, but seems this is the way to go.

--
jaime


Post a reply to this message


Attachments:
Download 'ocean-16.jpg' (147 KB)

Preview of image 'ocean-16.jpg'
ocean-16.jpg


 

From: Stephen
Subject: Re: Inversion
Date: 11 Apr 2016 06:54:39
Message: <570b826f$1@news.povray.org>
On 4/11/2016 11:13 AM, Jaime Vives Piqueres wrote:
> Still not what I want, but seems this is the way to go.


That looks just like before the foam starts streaming.
It is more than acceptable. Quite realistic, the horizon is not swamped 
with small detail but my eye can see the longer frequency waves as you 
would. It is only the foreground wave that needs a bit of breaking foam. 
You could hang it on your wall. :)

I think that you are working in the right area. What sort of time did it 
take? And what is the camera's FOV? I'm just curious.


-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: Inversion
Date: 11 Apr 2016 07:09:02
Message: <570b85ce$1@news.povray.org>
On 11-4-2016 12:13, Jaime Vives Piqueres wrote:
...
>     As you can see, the final pattern using the derivatives is tricky...
> I had to play with EPSILON to find a value suitable for the scale of my
> height_field and the "precision" I wanted. Then used select find the
> negative parts and convert them to positive, and scaling the values up
> because they are extremely small. Don't ask me how the hell I worked
> that out... attached is a first render showing the result. Still not
> what I want, but seems this is the way to go.
>

phew...! That is pretty good Jaime. Not yet there but very very close. I 
wanted to explore further some ideas proposed by Marc Jacquier in his 
sea code but I am not getting really anywhere. It probably is a dead 
end, but worth looking into.


-- 
Thomas


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Inversion
Date: 11 Apr 2016 07:23:47
Message: <570b8943@news.povray.org>
El 11/04/16 a las 12:54, Stephen escribió:
> I think that you are working in the right area. What sort of time
> did it take? And what is the camera's FOV? I'm just curious.

   Thanks... this one took only 11 seconds to parse (because the sea HF
is only 2048x2048, versus the final one of 10240x10240), and 17 minutes
to render (yes, the derivatives pattern is not much faster than the
proximity pattern, after all).

   About the camera, if you meant the angle... I don't know, I used
direction here:

   up 9*y right 16*x
   direction 16*z


--
jaime


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Inversion
Date: 11 Apr 2016 07:25:54
Message: <570b89c2$1@news.povray.org>
El 11/04/16 a las 13:08, Thomas de Groot escribió:
> On 11-4-2016 12:13, Jaime Vives Piqueres wrote: phew...! That is
> pretty good Jaime. Not yet there but very very close. I wanted to
> explore further some ideas proposed by Marc Jacquier in his sea code
> but I am not getting really anywhere. It probably is a dead end, but
> worth looking into.
>

   Thanks! I tried almost everything, and the only two approaches getting
some believable foam patterns are proximity and derivatives. I'm
suspecting a mix of the two would really do it...

--
jaime


Post a reply to this message

From: Stephen
Subject: Re: Inversion
Date: 11 Apr 2016 07:52:04
Message: <570b8fe4$1@news.povray.org>
On 4/11/2016 12:23 PM, Jaime Vives Piqueres wrote:
> El 11/04/16 a las 12:54, Stephen escribió:
>> I think that you are working in the right area. What sort of time
>> did it take? And what is the camera's FOV? I'm just curious.
>
>    Thanks... this one took only 11 seconds to parse (because the sea HF
> is only 2048x2048, versus the final one of 10240x10240), and 17 minutes
> to render (yes, the derivatives pattern is not much faster than the
> proximity pattern, after all).
>
>    About the camera, if you meant the angle... I don't know, I used
> direction here:
>
>    up 9*y right 16*x
>    direction 16*z
>


It looks really good full screen. I can actually see what looks like 
waves that have been reflected off a shore. Amazing what the brain will 
make of images. :-)

As it was a test you might have used a wide angle along the horizontal. 
To get a wider view.

That's not too bad a time. I would not want to put it in an animation at 
the larger resolution, though.


-- 

Regards
     Stephen


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 4 Messages >>>

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