POV-Ray : Newsgroups : povray.unofficial.patches : Help! POV-Man coordinate system problem with bicubic patch Server Time
1 Nov 2024 03:17:11 EDT (-0400)
  Help! POV-Man coordinate system problem with bicubic patch (Message 1 to 6 of 6)  
From: Eli Ewok Brody
Subject: Help! POV-Man coordinate system problem with bicubic patch
Date: 29 Jun 2001 07:59:57
Message: <3b3c6dbd@news.povray.org>
Hello all --

Maybe one of you can help me:

When importing an sPatch object, it seems to handle coordinates incorrectly.
I'm writing a renderman shader that depends on the z-component of the
surface normal. This works find on regular objects, but does not on bicubic
patches. I get all sorts of strange results. (For instance, one forth of my
patch union is shaded, and nothing else.)

Thank you,
-Eli


Post a reply to this message

From: Christoph Hormann
Subject: Re: Help! POV-Man coordinate system problem with bicubic patch
Date: 29 Jun 2001 08:17:12
Message: <3B3C721A.52A11592@gmx.de>
Eli Ewok Brody wrote:
> 
> Hello all --

Hello and welcome.

> 
> Maybe one of you can help me:
> 
> When importing an sPatch object, it seems to handle coordinates incorrectly.
> I'm writing a renderman shader that depends on the z-component of the
> surface normal. This works find on regular objects, but does not on bicubic
> patches. I get all sorts of strange results. (For instance, one forth of my
> patch union is shaded, and nothing else.)
> 

Without sample code it's quite difficult to say, but does 'trace()' retun
a correct normal vector?

Another thing: try the slope pattern that also uses the normal vector.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Help! POV-Man coordinate system problem with bicubic patch
Date: 29 Jun 2001 12:53:57
Message: <3B3CB32B.7483E915@comtrade.ee>
Eli Ewok Brody wrote:
> 
> Hello all --
> 
> Maybe one of you can help me:
> 
> When importing an sPatch object, it seems to handle coordinates incorrectly.
> I'm writing a renderman shader that depends on the z-component of the
> surface normal. This works find on regular objects, but does not on bicubic
> patches. I get all sorts of strange results. (For instance, one forth of my
> patch union is shaded, and nothing else.)
> 
> Thank you,
> -Eli

It would good to see source code for shader (and POV-Ray scene file with
patches) to provide help.
But here are some questions, which could be considered:
Are these strange results repeatable or do they change with next render
(without  changing shader or POV source code)? If it changes with next
render, then there is defect in source code probably, otherwise it is
shader/scene file problem.
How do you use surface normal? Do you transform it (e.g. to shading
space)? Do you use correct transformation function (normals and vectors
should be transformed by ntransform() and vtransform() accordingly,
transform() function should be used only for points).
Do you take account, that normal could point 'downward' i.e. be
negative? Do you assume, that normals are normalized (they may be and
they may be not)?
Try to render only these patches, which are not shaded and look, what is
the value for normal vector (printf function is handy here).
How are unshaded surfaces oriented?


Post a reply to this message

From: Christoph Hormann
Subject: Re: Help! POV-Man coordinate system problem with bicubic patch
Date: 30 Jun 2001 08:36:50
Message: <3B3DC839.9618D763@gmx.de>
Eli Ewok Brody wrote:
> 
>  I didn't give you any useful information at all. Sorry about that. Here is
> the source for the shader, and a sample file.

Please post such things in povray.binaries.scene-files.  See
also            povray.announce.frequently-asked-questions for the purpose
of the different groups.

> 
>  I bet someone's thought of this before, but the shader is a top-level dust.
> Generally: dust isn't as visible when looked at straight on, when the
> surface normal is at the same angle as the incident ray. Dust is visible,
> however, when looked at at a tangent. That part works nicely.
> 
>  Another thing about dust, though, is the fact that it tends to settle on
> the tops of objects. I like Z-axis being up, so I use that to add another
> factor in the opacity of the dust. This gives me weird bicubic patch
> problems, for some reason.
> 
>  I didn't understand anything you said about vectors. I really don't know
> much about them. (We learn that *next* year in math.....) Guess it's time to
> start reading up. If anything, I bet my understanding of transforming
> vectors is to blame.
> 

It does not seem to have anything to do with PovMan shaders, without the
shader and in official Povray 3.1 you can see the same problems.  It's
simply not possible to make a perfect sphere with bicubic patches.  Try
using the slope pattern and you will see that the normal vector behaves
quite strangely especially at the 'poles' of the 'sphere'.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Eli Ewok Brody
Subject: Re: Help! POV-Man coordinate system problem with bicubic patch
Date: 1 Jul 2001 09:07:09
Message: <3b3f207d@news.povray.org>
Didn't mean to breach posting rules.
 So fine, there's an intrinsic problem with bicubic patches and surface
normals. I don't really care that I can't make a sphere with them, they work
just fine for the other things I use them for (lathes and organic things
look great!).
 Does anyone have any suggestions? I just need a real Z-coord for the
surface normal.
 -Eli


Post a reply to this message

From: Christoph Hormann
Subject: Re: Help! POV-Man coordinate system problem with bicubic patch
Date: 1 Jul 2001 14:02:49
Message: <3B3F6612.45E3237F@gmx.de>
Eli Ewok Brody wrote:
> 
>  So fine, there's an intrinsic problem with bicubic patches and surface
> normals. 

No, that's not what i meant, the single patches are all right (AFAIK,
can't say for sure, but i'm quite sure someone would have recognized that
before if not)

The problem occurs when several patches are combined to a more complex
shape.  I'm no expert in bicubic patches so i don't know if there is a way
to get the patches fit together better here, but using a sphere object or
a smooth mesh would surely lead to more accurate results in either case.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

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