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.

Tasklist

FS#183 - cutaway_textures broken with child unions

Attached to Project: POV-Ray
Opened by Christoph Lipka (clipka) - Saturday, 18 December 2010, 03:29 GMT
Last edited by William F Pokorny (wfpokorny) - Saturday, 21 January 2017, 17:22 GMT
Task Type Possible Bug
Category Backend → Texture/Material/Finish
Status Tracked on GitHub
Assigned To Christoph Lipka (clipka)
Operating System All
Severity Low
Priority Normal
Reported Version 3.70 beta 40
Due in Version Future release
Due Date Undecided
Percent Complete 50%
Votes 2
Private No

Details

When using cutaway_textures in a CSG object that has union children, results are not as expected; instead, surfaces in the union children that have no explicit texture will be rendered with the default texture instead. This is not the case for e.g. difference children.

Example:

#default { texture { pigment { rgb 1 } } }

camera {
  right x*image_width/image_height
  location  <0,1.5,-4>
  look_at   <0,1,0>
}

light_source { <500,500,-500> color rgb 1 }

#declare U = union {
  sphere { <0,-0.1,-1>, 0.3 }
  sphere { <0, 0.1,-1>, 0.3 pigment { color red 1 } }
}

intersection {
  sphere { <0,0,0>, 1 pigment { color green 1 } }
  object { U }
  cutaway_textures
  rotate y*90
}

When declaring U as an intersection instead, the results are as expected, with the surface of the first sphere in U being rendered with the texture defined in the outer intersection.

This task depends upon

Comment by Michael Sander (SolarMike) - Wednesday, 29 December 2010, 21:03 GMT

I have taken a first attempt at looking at (and building) the source. So far what I have found is that it seems the default texture has been applied to the union object without a texture. When the final texture is evaluated, the texture is non-null and so treats that as an applied texture. The object gets this texture when line 9383 of parse.cpp (beta 41) is executed. I tried changing the logic around this statement from an OR to an AND and my test rendering came out correct (though this could easily not be the correct solution.)

Cheers,
Mike

Comment by Christoph Lipka (clipka) - Wednesday, 29 December 2010, 23:35 GMT

A solution actually exists already, but backward compatibility issues are still to be solved, so it won't be implemented in 3.7.0.

Comment by Michael Sander (SolarMike) - Thursday, 30 December 2010, 05:03 GMT

Thanks Christoph. :)

Does this solution exist anywhere I can get a hold of it? I very much appreciate the efforts you have put in.

Comment by Michael Sander (SolarMike) - Thursday, 30 December 2010, 05:23 GMT

Actually, this is no longer a pressing issue for me as my parts are rendering correctly with my change.

Thanks again,
Mike

Comment by Grimbert Jérôme (Le_Forgeron) - Saturday, 21 May 2011, 16:39 GMT

Testing again (3.7RC3)
* intersection gives a yellow surface (green+red) with cutaway_textures (I find it strange)
* union gives a white surface (which is not the color of first item in intersection, so cutaway is useless)
* difference gives a green surface (which is ok)

Adding an explicit pigment at the intersection (instead of the first member):
* union gives a green surface (kind of ok)
* intersection too (ok also)
* difference is ok too.

Comment by Christoph Lipka (clipka) - Monday, 30 May 2011, 09:44 GMT

Did I mention already that, although a solution does exist, it's not bound for 3.70? Consequently it's no surprise that 3.7RC3 still gives unexpected results ;-)

Comment by William F Pokorny (wfpokorny) - Saturday, 21 January 2017, 17:22 GMT
  • Field changed: Status (Assigned → Tracked on GitHub)

Now tracked on gitub as issue #207.

Loading...