LDCad POVray export - Printable Version +- LDraw.org Discussion Forums (https://forums.ldraw.org) +-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html) +--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html) +--- Thread: LDCad POVray export (/thread-22717.html) |
LDCad POVray export - Michael Horvath - 2018-02-17 A couple of observations. 1. slope bricks are not bumpy/grainy like they should be 2. at the POV-Ray newsgroups we came up with some code to add blurred reflections to models: Code: // this methoid is slower Unfortunately, there's no way to differentiate between ABS (solid) and Polycarbonate (clear) plastics. Could you add another column to the `ldColor` array for the `BlurAmount` value, in addition to `ior`? It would be great. See also: https://www.eurobricks.com/forum/index.php?/forums/topic/159291-pov-ray-surface-realism/ http://news.povray.org/povray.binaries.images/thread/%3C5a8191e7%241%40news.povray.org%3E/ Thanks! RE: LDCad POVray export - Roland Melkert - 2018-02-18 (2018-02-17, 21:47)Michael Horvath Wrote: A couple of observations. 1: Those would require .dat changes and an extension to the texture map spec to allow for bump maps or something like that. 2: You could check on alpha being <1.0 ( ldColor[getColorIndex(ldCode)][4]<1.0 ) for transparent ones. If you need an extra parameter you could declare an array for mapping the odd ones, e.g. Code: #declare ldColorBlurCount=3; FYI: did you notice you can apply your modifications to material definitions in the %appdata%/LDCad/povray/default/colors.pov file to avoid to have to post process each export. Or copy the default map so you can choose which set of scripts to use during export. RE: LDCad POVray export - Michael Horvath - 2018-02-18 (2018-02-18, 21:01)Roland Melkert Wrote: 1: For some reason I recalled L3P supporting parts with bumps, but this apparently is only true for LGEO parts. My mistake. (2018-02-18, 21:01)Roland Melkert Wrote: 2: Yes, I can make my own array. But I was hoping for official support within LDCad. (2018-02-18, 21:01)Roland Melkert Wrote: FYI: did you notice you can apply your modifications to material definitions in the %appdata%/LDCad/povray/default/colors.pov file to avoid to have to post process each export. Or copy the default map so you can choose which set of scripts to use during export. I already delete all colors from each POV file and simply link to an external INC file with colors in it. I do this for L3P and LDView, as well, so now I can swap between all three whenever I want to in any model. RE: LDCad POVray export - Roland Melkert - 2018-02-18 (2018-02-18, 21:28)Michael Horvath Wrote: Yes, I can make my own array. But I was hoping for official support within LDCad. I wouldn't know where to get the values from unless they are added to !COLOUR meta's or something. RE: LDCad POVray export - Michael Horvath - 2018-02-18 (2018-02-18, 21:48)Roland Melkert Wrote:(2018-02-18, 21:28)Michael Horvath Wrote: Yes, I can make my own array. But I was hoping for official support within LDCad. "LDConfig.ldr" does not specify anything other than color, so you must have come up with your own values for `ior`, `reflection`, `diffuse`, `specular`, etc. etc. `BlurAmount` is just one added value. Maybe instead of storing `ior` in the array, you should instead store the material type? E.g. ABS = 1, polycarbonate = 2, rubber = 3, chrome = 4, pearl = 6, metal = 7, etc. etc. Regardless, you use the `ldrawTexPlastic` macro for both regular plastic bricks and transparent plastic bricks. Since they are two different types of plastics (ABS versus polycarbonate) they should probably use different textures/materials. The POV-Ray newsgroup may be able to offer tips on what values you should use for materials. RE: LDCad POVray export - Orion Pobursky - 2018-02-18 (2018-02-18, 23:03)Michael Horvath Wrote:(2018-02-18, 21:48)Roland Melkert Wrote: I wouldn't know where to get the values from unless they are added to !COLOUR meta's or something. Even if you differentiate between plastics, the refraction still won’t be quite right since the converter makes meshes and not solid geometry. RE: LDCad POVray export - Michael Horvath - 2018-02-18 (2018-02-18, 23:31)Orion Pobursky Wrote:(2018-02-18, 23:03)Michael Horvath Wrote: "LDConfig.ldr" does not specify anything other than color, so you must have come up with your own values for `ior`, `reflection`, `diffuse`, `specular`, etc. etc. `BlurAmount` is just one added value. Maybe instead of storing `ior` in the array, you should instead store the material type? E.g. ABS = 1, polycarbonate = 2, rubber = 3, chrome = 4, pearl = 6, metal = 7, etc. etc. I'm talking about blurred reflections, not blurred refractions. Also, why do you store `ior` info if your geometry is not solid? RE: LDCad POVray export - Orion Pobursky - 2018-02-18 (2018-02-18, 23:43)Michael Horvath Wrote:(2018-02-18, 23:31)Orion Pobursky Wrote: Even if you differentiate between plastics, the refraction still won’t be quite right since the converter makes meshes and not solid geometry. Light transmittal through the material affects the reflection. Also, reflection should be more of a function of material smoothness and not plastic type. RE: LDCad POVray export - Michael Horvath - 2018-02-19 (2018-02-18, 23:50)Orion Pobursky Wrote:(2018-02-18, 23:43)Michael Horvath Wrote: I'm talking about blurred reflections, not blurred refractions. Sorry, I got you and Roland mixed up earlier. I think LDCad output meshes *are* solid, which is why `ior` (index of refraction) is specified for transparent parts. (Otherwise there would generally not be a point in specifying `ior`.) Also, Roland *already* does differentiate between types of plastic by specifying different `ior` values for transparent and non-transparent parts. He just doesn't do this for finishes as well. [ed. correction: there is no `ior` specified for non-transparent parts.] Anyway, blurred reflections don't look realistic on transparent parts. Something has to be done about this. RE: LDCad POVray export - Orion Pobursky - 2018-02-19 (2018-02-19, 1:50)Michael Horvath Wrote: Sorry, I got you and Roland mixed up earlier. I think LDCad output meshes *are* solid, which is why `ior` (index of refraction) is specified for transparent parts. No they aren’t. Nothing that is a mesh is. This is why I started the LDraw POV project. Admittedly, I have no idea if it makes a huge difference and, if there is a noticeable difference, if it is worth the trouble for non-high res renders. RE: LDCad POVray export - Michael Horvath - 2018-02-19 (2018-02-19, 2:05)Orion Pobursky Wrote:(2018-02-19, 1:50)Michael Horvath Wrote: Sorry, I got you and Roland mixed up earlier. I think LDCad output meshes *are* solid, which is why `ior` (index of refraction) is specified for transparent parts. Well, the blurred reflections *are* noticeable in non-high res renders, and they require a blur value as well as ior. RE: LDCad POVray export - Michael Horvath - 2018-02-19 Is seam width the total distance between two bricks, or just half the distance? RE: LDCad POVray export - Roland Melkert - 2018-02-19 (2018-02-19, 6:00)Michael Horvath Wrote: Is seam width the total distance between two bricks, or just half the distance? Total space in between bricks. A brick gets scaled by (size-seamWidth)/size. So it has half the seamWidth per side left over. RE: LDCad POVray export - Michael Horvath - 2018-03-03 (2018-02-19, 2:05)Orion Pobursky Wrote:(2018-02-19, 1:50)Michael Horvath Wrote: Sorry, I got you and Roland mixed up earlier. I think LDCad output meshes *are* solid, which is why `ior` (index of refraction) is specified for transparent parts. It seems solid meshes are possible in POV-Ray if you define an "inside_vector". But I have seen gaps between LDraw sub-parts, for instance where a low-res cylinder meets a high-res hole, or something similar. So maybe these are not "well-behaved". http://wiki.povray.org/content/Reference:Mesh Code: Solid Mesh RE: LDCad POVray export - Philippe Hurbain - 2018-03-03 (2018-03-03, 12:18)Michael Horvath Wrote: It seems solid meshes are possible in POV-Ray if you define an "inside_vector". But I have seen gaps between LDraw sub-parts, for instance where a low-res cylinder meets a high-res hole, or something similar. So maybe these are not "well-behaved"There is definitely no clearly defined inside in most LDraw parts... RE: LDCad POVray export - Roland Melkert - 2018-03-03 (2018-03-03, 13:10)Philippe Hurbain Wrote:(2018-03-03, 12:18)Michael Horvath Wrote: It seems solid meshes are possible in POV-Ray if you define an "inside_vector". But I have seen gaps between LDraw sub-parts, for instance where a low-res cylinder meets a high-res hole, or something similar. So maybe these are not "well-behaved"There is definitely no clearly defined inside in most LDraw parts... Having normals in mesh2 should do the trickp too, I already define an "interior" in LDCad's pov export. This controls transparency without the use of alpha. |