POV-Ray

The Persistence of Vision Raytracer (POV-Ray).

This is the legacy Bug Tracking System for the POV-Ray project. Bugs listed here are being migrated to our github issue tracker. Please refer to that for new reports or updates to existing ones on this system.

Attached to Project: POV-Ray
Opened by Grimbert Jérôme - 2013-06-24
Last edited by Christoph Lipka - 2016-12-13

FS#298 - the warning for isosurface does not appears as often as with 3.6.1

From synthetic post of Cousin Ricky in p.beta-test, 2013-06-24 circa 3:19 pm (MST)

William F Pokorny anonymous@anonymous.org wrote:
> It seems to be the case the gradient warnings are only generated if the
> isosurface is naked. If it is wrapped in an object as was the case with
> my thread safety example, we get no warnings.

Confirmed. If only I still had the concentration required to investigate
computer code.

#version 3.7;

#ifndef (MG) #declare MG = 40/9; #end
#ifndef (Naked) #declare Naked = no; #end

global_settings
{ assumed_gamma 1
  radiosity {} //force isosurface calculations from all directions
}

light_source { <-3.3125, 7.6250, -5.7374>, rgb 1 }

camera
{ location <0.0000, 1.0000, -5.6713>
  look_at <-0.7969, 1.2000, -0.0598>
  angle 10.7447
}

#include "functions.inc"

#if (Naked)
  isosurface
  { function { f_sphere (x, 0, z, (2660 - 40*y) / 9) }
    contained_by { box { <-80, 31, -24>, <-128, 56, 24> } }
    max_gradient MG
    pigment { rgb <1, 0.75, 0> }
    scale 1/128
    rotate -35 * x
    translate y
  }
#else
  #declare Test = isosurface
  { function { f_sphere (x, 0, z, (2660 - 40*y) / 9) }
    contained_by { box { <-80, 31, -24>, <-128, 56, 24> } }
    max_gradient MG
    pigment { rgb <1, 0.75, 0> }
    scale 1/128
    rotate -35 * x
    translate y
  }
  object { Test }
#end

On the command line, try:

declare=MG=1 declare=Naked=1

and

declare=MG=1 declare=Naked=0

To lose the warning, I had to declare the isosurface. Just wrapping the naked
isosurface in an object{} generated a warning.

Further analysis

isCopy seems to be intended to avoid displaying the same warning over
and over for the same isosurface (as duplicated isosurface indeed are
not copied but reference the same sub-structure).

#declare Ob = isosurface{...}; that’s not a copy
object {Ob ... }
that’s a copy

Previously (3.6.1) the warning was displayed at the destruction of the
isosurface (when the sub-structure was actually referenced by no one else)

if((Stage == STAGE_SHUTDOWN) && (mginfo->refcnt == 0))

In 3.7, isCopy was introduced with change 4707, 16th February 2009,
along with the change introducing means for objects to submit message on
shutdown.
It was reported in windows source with change 4714, 21th February 2009.

If the symptom “isosurface embbeded in object (CSG) does not show the
warning” is correct, it might be a “feature/bug”. The parser copied the
isosurface object and deleted the original before the render started.
When the render ends, it find only copies and because the refcnt is not
used anymore (for that purpose), it miss the last remaining true data to
display.

Instead of isCopy, what about adding in mginfo a boolean
“printed_warning” (actual name should be more appropriate), set to false
on creation, and turn to true on the first call (instead of last for
3.6.1) of the warning displaying function (test for false, set to true
if false) ? (and dropping isCopy in the process)

For instance, i’m afraid the following sequence would fails with current
code:

#declare Foo = isosurface{ ... };
#declare Bar = object { Foo ... };
#undef Foo;

(or any pop of #local context, such as building the isosurface via macro
or loop, or replacing the value of a previous #declare/#local )

Closed by  Christoph Lipka
Tuesday, 13 December 2016, 06:03 GMT
Reason for closing:  Fixed
Grimbert Jérôme commented on Monday, 24 June 2013, 09:43 GMT

correction tested in 5912 (not the smp branch).
Easy, works fine (but do not address #296).

Basically: remove isCopy field and create a print_done field deeper in the data.

William F Pokorny commented on Tuesday, 11 October 2016, 15:08 GMT

Now tracked on GitHub as #114.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing