Varying width in Curves (bug)

View: New views
7 Messages — Rating Filter:   Alert me  

Varying width in Curves (bug)

by Trevor Lovett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In working on the curves refactor I noticed what I think is a bug in our implementation.  I'm trying to render this curve (not in hair-mode with clean aqsis checkout):
Curves "cubic" [9] "nonperiodic" "P" [-100 0 -100
-100 0 -100 -100 0 -100 -20 -34.6411 -60 20 -7.50795 10
40 14.3218 60 90 -8.57245 90 90 -8.57245 90 90 -8.57245 90] "N" [0 1 0 0 0 1 0 1 0 0 0 1 0 1 0] "width" [20 30]

And I get visual garbage.  I instrumented the code a little and it looks like the widths are not being populated correctly.  Can any of the other devs remember a time when varying-width curves worked?  Perhaps I'm not using this parameter correctly?

Attached is a rib if anyone would like to repro.

Also, I believe the existing curves implementation isn't respecting the width parameter (when it works in the "constantwidth" context).  The rendered (cubic patch) curves appear twice as wide as they should be.

Trevor  


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

hair2.rib (1K) Download Attachment

Re: Varying width in Curves (bug)

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Aug 11, 2009 at 11:01 PM, Trevor Lovett<trevlovett@...> wrote:
> In working on the curves refactor I noticed what I think is a bug in our
> implementation.  I'm trying to render this curve (not in hair-mode with
> clean aqsis checkout):
> Curves "cubic" [9] "nonperiodic" "P" [-100 0 -100
> -100 0 -100 -100 0 -100 -20 -34.6411 -60 20 -7.50795 10
> 40 14.3218 60 90 -8.57245 90 90 -8.57245 90 90 -8.57245 90] "N" [0 1 0 0 0 1
> 0 1 0 0 0 1 0 1 0] "width" [20 30]
> And I get visual garbage.

IIRC there's a test of variable width curves in the regression test
suite.  Look at the pictures rendered from the Primitives/Curves
directory.

At a glance, it looks to me like you're not providing the correct number
of widths.  "width" will be of type "varying float" by default, so you
need to provide N+1 widths where N is the number of curve segments.

> Attached is a rib if anyone would like to repro.
> Also, I believe the existing curves implementation isn't respecting the
> width parameter (when it works in the "constantwidth" context).

Sure, that could be the case; I'll have to check later (bed time now).

~Chris.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

Re: Varying width in Curves (bug)

by Trevor Lovett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah you were right about that first point--I thought you could only provide a start and end width.  Seems to be working, and in hair-mode.

On Tue, Aug 11, 2009 at 3:37 PM, Chris Foster <chris42f@...> wrote:
On Tue, Aug 11, 2009 at 11:01 PM, Trevor Lovett<trevlovett@...> wrote:
> In working on the curves refactor I noticed what I think is a bug in our
> implementation.  I'm trying to render this curve (not in hair-mode with
> clean aqsis checkout):
> Curves "cubic" [9] "nonperiodic" "P" [-100 0 -100
> -100 0 -100 -100 0 -100 -20 -34.6411 -60 20 -7.50795 10
> 40 14.3218 60 90 -8.57245 90 90 -8.57245 90 90 -8.57245 90] "N" [0 1 0 0 0 1
> 0 1 0 0 0 1 0 1 0] "width" [20 30]
> And I get visual garbage.

IIRC there's a test of variable width curves in the regression test
suite.  Look at the pictures rendered from the Primitives/Curves
directory.

At a glance, it looks to me like you're not providing the correct number
of widths.  "width" will be of type "varying float" by default, so you
need to provide N+1 widths where N is the number of curve segments.

> Attached is a rib if anyone would like to repro.
> Also, I believe the existing curves implementation isn't respecting the
> width parameter (when it works in the "constantwidth" context).

Sure, that could be the case; I'll have to check later (bed time now).

~Chris.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

Re: Varying width in Curves (bug)

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Aug 11, 2009 at 11:37 PM, Chris Foster<chris42f@...> wrote:
>> Also, I believe the existing curves implementation isn't respecting the
>> width parameter (when it works in the "constantwidth" context).
>
> Sure, that could be the case; I'll have to check later (bed time now).
>
>> The rendered (cubic patch) curves appear twice as wide as they should be.

I think the width parameter is working fine - see the attached RIB which I
specifically created to test this out.

~Chris.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

simple_curves.rib (1K) Download Attachment

Re: Varying width in Curves (bug)

by Trevor Lovett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It is working fine--there was a bug in my code that is now fixed so widths are good.  I just did a push of my latest changes.

I've discovered an issue in my code now--we get cracking in the hair-mode curves in regions of high curvature (your example rib).  See attached screenshot.

I've gone through the usual sanity checks, however I think the problem could be with CalculateTangent().  I did a dump of the tangents at (start, end) vertices for each segment and noticed that at least one (start, end) tangent-pair didn't match up with an (end, start) pair (And these were not segments at the end of the larger curve).  I don't know what else to conclude, since in this case the normal vectors are constant, they're not the issue.  That just leaves the T term that is supsicious.

Attached is test rib as well.  Appreciate your thoughts.

On Wed, Aug 12, 2009 at 4:22 AM, Chris Foster <chris42f@...> wrote:
On Tue, Aug 11, 2009 at 11:37 PM, Chris Foster<chris42f@...> wrote:
>> Also, I believe the existing curves implementation isn't respecting the
>> width parameter (when it works in the "constantwidth" context).
>
> Sure, that could be the case; I'll have to check later (bed time now).
>
>> The rendered (cubic patch) curves appear twice as wide as they should be.

I think the width parameter is working fine - see the attached RIB which I
specifically created to test this out.

~Chris.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development





------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

Picture 1.png (33K) Download Attachment
simple.rib (1K) Download Attachment

Re: Varying width in Curves (bug)

by Trevor Lovett :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Wed, Aug 12, 2009 at 4:07 PM, Trevor Lovett <trevlovett@...> wrote:
It is working fine--there was a bug in my code that is now fixed so widths are good.  I just did a push of my latest changes.

I've discovered an issue in my code now--we get cracking in the hair-mode curves in regions of high curvature (your example rib).  See attached screenshot.

I've gone through the usual sanity checks, however I think the problem could be with CalculateTangent().  I did a dump of the tangents at (start, end) vertices for each segment and noticed that at least one (start, end) tangent-pair didn't match up with an (end, start) pair (And these were not segments at the end of the larger curve). 

Ick, should rephrase that:
The tangent vectors don't always line up at segment endpoints.

 
I don't know what else to conclude, since in this case the normal vectors are constant, they're not the issue.  That just leaves the T term that is supsicious.

Attached is test rib as well.  Appreciate your thoughts.

On Wed, Aug 12, 2009 at 4:22 AM, Chris Foster <chris42f@...> wrote:
On Tue, Aug 11, 2009 at 11:37 PM, Chris Foster<chris42f@...> wrote:
>> Also, I believe the existing curves implementation isn't respecting the
>> width parameter (when it works in the "constantwidth" context).
>
> Sure, that could be the case; I'll have to check later (bed time now).
>
>> The rendered (cubic patch) curves appear twice as wide as they should be.

I think the width parameter is working fine - see the attached RIB which I
specifically created to test this out.

~Chris.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

Re: Varying width in Curves (bug)

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Aug 13, 2009 at 12:07 AM, Trevor Lovett<trevlovett@...> wrote:
> I've gone through the usual sanity checks, however I think the problem could
> be with CalculateTangent().  I did a dump of the tangents at (start, end)
> vertices for each segment and noticed that at least one (start, end)
> tangent-pair didn't match up with an (end, start) pair (And these were not
> segments at the end of the larger curve).  I don't know what else to
> conclude, since in this case the normal vectors are constant, they're not
> the issue.  That just leaves the T term that is supsicious.

Sounds possible.  I can't really look into this further tonight since I need
to get some sleep...

Something I noticed is that even the non-hair curves seem to be having some
trouble in that scene.  Notice the slightly sharp feature at the point of max
curvature.  I rendered this with 3delight for something else I was testing,
and noticed that 3delight does a much better job of keeping the curve smooth
at the point of maximum curvature.

> Attached is test rib as well.  Appreciate your thoughts.

Not that it's got anything to do with your problem... but I noticed that
you've got an unnecessary attribute block there.  (You don't need an attribute
block to use attributes.)

I'll try to get back to you tomorrow about this if you haven't figured it out
by then.
~Chris.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development