Set Slope surface bumps for Ldview Pov-ray export


Set Slope surface bumps for Ldview Pov-ray export
#1
I would like to know if there is a way to change the default 0.3 Bumps on slope parts (used to simulate the slope granularity) to an other value. As for me 1 Bumps would better fit for my renders but it seems that ldview automatically choose a value of 0.3.

Is there anyway to change that instead of manually editing the Pov-ray file ?
Reply
Re: Set Slope surface bumps for Ldview Pov-ray export
#2
It's possible, but not trivial. Unfortunately, that's not something I expected to be requested. First, you need to go into the POV export options in LDView, and fill in a filename for the Top include. Then, create that file, and put is somewhere that POV can find it via #include. Then, inside that file, define the colors used by LDView. You can simply copy LDView's definition into your file and change it, or you can find someone else's custom definition on the Internet. The key is that if you define a color using the same name that LDView uses, LDView's definition will be skipped.

So, for example, to redefine the black slope color with LGEO enabled, add the following to your include file:
Code:
#declare LDXColor0 = #if (version >= 3.1) material { #end
        texture {
                lg_black
        }
#if (version >= 3.1) } #end
#declare LDXColor0_slope = #if (version >= 3.1) material { #end
        texture {
                lg_black
                #if (LDXQual > 1) normal { bumps 1 scale 25*0.02 } #end
        }
#if (version >= 3.1) } #end

Note that you can't define just the slope color. You have to define both the slope color and the standard color, because LDView's #ifndef only checks the main color name (LDXColor0 in the example above).

If you're going to do this for colors, I would recommend creating a second file with your custom color definitions in it and nothing else. Then, #include the color file from your custom Top include. That way, if in the future you want to customize other stuff, you don't have a bunch of unrelated stuff mixed up in the same file.
Reply
Re: Set Slope surface bumps for Ldview Pov-ray export
#3
OK, thanks for the answer.

I'm just wondering: the black color will be defined two times that way, one time in my Top include file, and one time in the main file.
Will it only take the first occurence into account?
Reply
Re: Set Slope surface bumps for Ldview Pov-ray export
#6
If you look at the color definition code inside the POV file that LDView creates, you will see that it surrounds each color definition inside a block saying #ifndef <ColorName>. Because of this, it will use the definition from your include file (as long as you carefully give it the same name), and ignore the definition inside the POV file generated by LDView. If the #ifndef statement weren't there, it would probably use the version in the file and ignore your definition. I don't remember enough about POV code, though; it might instead generate an error when the color was redefined. I do suspect that even if it didn't generate an error, it would generate a warning.
Reply
Re: Set Slope surface bumps for Ldview Pov-ray export
#4
I have also found out that if the characters "+" or "&" are used inside a sub model name, Pov's file exported by Ldview will not be redable.

I think "+" should be replace by "plus" or "&" by "and" during export, like it is done by " " with "space"
Reply
Re: Set Slope surface bumps for Ldview Pov-ray export
#5
Thanks. This is a known bug, which I have fixed in my source code, and will be fixed whenever I finally manage to get the next version released.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 2 Guest(s)
Forum Jump:


Users browsing this thread: 2 Guest(s)