POV-Ray : Newsgroups : povray.advanced-users : Rendering wet sponge Server Time
23 Nov 2024 20:39:34 EST (-0500)
  Rendering wet sponge (Message 1 to 5 of 5)  
From: Saket
Subject: Rendering wet sponge
Date: 15 Aug 2011 09:40:00
Message: <web.4e492118fde8c643e30a4f6b0@news.povray.org>
Hi,

I need to render wet sponge something like this
http://www.stanford.edu/~patkar/lenaerts.JPG

The sponge is a triangle mesh (surface mesh). I have a dry sponge texture and I
am using povray's mesh with uv mapping for rendering dry sponge. Now I need to
render some of the tringles darker depending on how wet they are. Is there a way
to do it without modifying the texture file?

I am using c++ to generate the povray file. The information I have is the list
of triangles, u,v coordinates of each triangle and degree of wetness of each
triangle. I do not want to modify the texture file because I have to do this for
100's of frames to get an animation.

Can someone help?

Thanks,
Saket


Post a reply to this message

From: Le Forgeron
Subject: Re: Rendering wet sponge
Date: 15 Aug 2011 11:35:02
Message: <4e493ca6$1@news.povray.org>
Le 15/08/2011 15:37, Saket nous fit lire :
> Hi,
> 
> I need to render wet sponge something like this
> http://www.stanford.edu/~patkar/lenaerts.JPG
> 
> The sponge is a triangle mesh (surface mesh). I have a dry sponge texture and I
> am using povray's mesh with uv mapping for rendering dry sponge. Now I need to
> render some of the tringles darker depending on how wet they are. Is there a way
> to do it without modifying the texture file?
> 
> I am using c++ to generate the povray file. The information I have is the list
> of triangles, u,v coordinates of each triangle and degree of wetness of each
> triangle. I do not want to modify the texture file because I have to do this for
> 100's of frames to get an animation.
> 
> Can someone help?

Just an idea: keep the sponge dry and add filtering/transmitting spheres
based on wetness.
If dry->wet darkens, a normal filtering is fine. (range 0 to 1)
If dry->wet lighten, you need a filtering factor which multiply the
actual colour.

If the triangle mesh was open to update with its own texture (no need to
UV map), it would be a simpler issue of using a palette of texture based
on wetness.


Post a reply to this message

From: Saket
Subject: Re: Rendering wet sponge
Date: 16 Aug 2011 02:35:00
Message: <web.4e4a0e786cc3925c420ab3060@news.povray.org>
> Just an idea: keep the sponge dry and add filtering/transmitting spheres
> based on wetness.
> If dry->wet darkens, a normal filtering is fine. (range 0 to 1)
> If dry->wet lighten, you need a filtering factor which multiply the
> actual colour.


>
> If the triangle mesh was open to update with its own texture (no need to
> UV map), it would be a simpler issue of using a palette of texture based
> on wetness.

Hi,

Thanks for the reply.

As to your first point are you suggesting adding filtering spheres outside every
wet triangle?

Can you explain your last point?

I was planning to generate a filtering texture every frame and layer it over the
sponge texture, but povray wouldn't allow layering over an image map.

Saket


Post a reply to this message

From: Le Forgeron
Subject: Re: Rendering wet sponge
Date: 16 Aug 2011 04:40:08
Message: <4e4a2ce8$1@news.povray.org>
Le 16/08/2011 08:30, Saket a écrit :
>> Just an idea: keep the sponge dry and add filtering/transmitting spheres
>> based on wetness.
>> If dry->wet darkens, a normal filtering is fine. (range 0 to 1)
>> If dry->wet lighten, you need a filtering factor which multiply the
>> actual colour.

(actually, that would be a transmit factor > 1)

>>
>> If the triangle mesh was open to update with its own texture (no need to
>> UV map), it would be a simpler issue of using a palette of texture based
>> on wetness.
> 
> Hi,
> 
> Thanks for the reply.
> 
> As to your first point are you suggesting adding filtering spheres outside every
> wet triangle?

I'm dumber. outside every wet vertex. (yes, a lot of tiny spheres!)
You need to raise max_trace_level a lot if not using version 3.7;

> 
> Can you explain your last point?

Mesh can have a texture per vertex (see the mesh2 syntax).

> mesh2 {
>    vertex_vectors {
>       9, 
>       <0,0,0>, <0.5,0,0>, <0.5,0.5,0>,
>       <1,0,0>, <1,0.5,0>, <1,1,0>   
>       <0.5,1,0>, <0,1,0>, <0,0.5,0> 
>    }
>    texture_list {
>       3,
>       texture{pigment{rgb <0,0,1>}}
>       texture{pigment{rgb 1}}
>       texture{pigment{rgb <1,0,0>}}
>    }
>    face_indices {
>       8, 
>       <0,1,2>,0,1,2,  <1,3,2>,1,0,2,
>       <3,4,2>,0,1,2,  <4,5,2>,1,0,2,
>       <5,6,2>,0,1,2,  <6,7,2>,1,0,2,
>       <7,8,2>,0,1,2,  <8,0,2>,1,0,2
>    }
> }

Assuming you start with a dry mesh with a texture list of 10 textures,
and you have 20 degrees of wetness (per dry texture),
the dry-mesh with 10 textures would transform into a dry-and-wet-mesh
with 200 textures.

On the specification of the face_indices, your program would simply put
the right texture index according to the original mesh and the wetness.


Post a reply to this message

From: Saket
Subject: Re: Rendering wet sponge
Date: 16 Aug 2011 09:05:01
Message: <web.4e4a6ad96cc3925cdb59c7120@news.povray.org>
> Assuming you start with a dry mesh with a texture list of 10 textures,
> and you have 20 degrees of wetness (per dry texture),
> the dry-mesh with 10 textures would transform into a dry-and-wet-mesh
> with 200 textures.
>
> On the specification of the face_indices, your program would simply put
> the right texture index according to the original mesh and the wetness.

Thanks,

Mesh2 worked perfectly.


Saket


Post a reply to this message

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