POV-Ray : Newsgroups : povray.general : remap RGBT color to anther RGBT color? Server Time
30 Jul 2024 10:14:44 EDT (-0400)
  remap RGBT color to anther RGBT color? (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Tor Olav Kristensen
Subject: Re: remap RGBT color to anther RGBT color?
Date: 11 Jul 2009 11:16:10
Message: <4a58acba@news.povray.org>
caduser wrote:
> Christian Froeschlin <chr### [at] chrfrde> wrote:
> 
>> Just out of curiosity: Does this mean your CAD program comes
>> with a POV-Ray export option built in?
> Yes that is right it is one of our image output options.
> 
>> As Chris has said, textually processing the generated sdl script
>> with an editor macro (or perl script or similar) is probably your
>> best option.
> 
> So far I have been using a replace all batch but this was to test samples. The
> program has 2 options one to output full size renders for use in print and
> second to generate preview icons for browsing inside the application, this runs
> it's own internal batch of generating a temp POV then rendering and can be run
> on thousands of objects. If I have to edit them all I have to use the render
> single image so I can uncheck start render and then keep all the POV files.

You can use a single-line sed call (in unix like operating systems
or wtih Cygwin in windows) to edit as many files you like in one go.

E.g. like this:

   sed -i 's/rgbt <0.,0.,0.,0.>/Gray20/' *.pov

Alse see:

   http://unixhelp.ed.ac.uk/CGI/man-cgi?sed
   http://www-h.eng.cam.ac.uk/help/tpl/unix/sed.html
   http://www.cygwin.com/

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Christian Froeschlin
Subject: Re: remap RGBT color to anther RGBT color?
Date: 11 Jul 2009 18:17:38
Message: <4a590f82$1@news.povray.org>
Chris B wrote:
> 
> "caduser" <nomail@nomail> wrote in message 
> news:web.4a588d74bddeda84dbd439ba0@news.povray.org...
>> It seems if there is a way it would be the material file not the inc 
>> file right?
>> When I tried my colleagues approach:
>>
>> <%MATERIAL
>> texture {
>>    pigment
>>      {
>>          color rgbt <<%R%> * 0.8 + 0.2,<%G%> * 0.8 + 0.2,<%B%> * 0.8 +
>> 0.2,<%A%>>
>>
>>      }
>> It did work for Black but shifts every color if there was a way at 
>> this point to
>> just push one color value.
>> I also need to look more at the reflectivity discussed early see if I 
>> can make
>> Black reflect enough to not be pure black in the render.
>>
> 
> So did you try the other suggestions for your 'material' file (min, max 
> or clip)?
> They would seem to be able to do exactly what you're asking for.

I think he did not want to have colors change except pure Black/White.

However, if the above syntax allows you to configure the output then
it would seem you can insert arbitrary code into the SDL, e.g.,

<%MATERIAL
   texture {
     pigment {
       #local RED   = <%R%>;
       #local GREEN = <%G%>;
       #local BLUE  = <%B%>;
       #if (RED = 0 & GREEN = 0 & BLUE  = 0)
         #local RED   = 0.1;
         #local GREEN = 0.1;
         #local BLUE  = 0.1;
       #end
       #if (RED = 1 & GREEN = 1 & BLUE  = 1)
         #local RED   = 0.9;
         #local GREEN = 0.9;
         #local BLUE  = 0.9;
       #end
      color rgbt <RED, GREEN, BLUE, <%A%>>

      ...


Post a reply to this message

From: caduser
Subject: Re: remap RGBT color to anther RGBT color?
Date: 11 Jul 2009 20:35:00
Message: <web.4a592f0bbddeda84dbd439ba0@news.povray.org>
> Chris B wrote:

>
> I think he did not want to have colors change except pure Black/White.
>
> However, if the above syntax allows you to configure the output then
> it would seem you can insert arbitrary code into the SDL, e.g.,
>
> <%MATERIAL
>    texture {
>      pigment {
>        #local RED   = <%R%>;
>        #local GREEN = <%G%>;
>        #local BLUE  = <%B%>;
>        #if (RED = 0 & GREEN = 0 & BLUE  = 0)
>          #local RED   = 0.1;
>          #local GREEN = 0.1;
>          #local BLUE  = 0.1;
>        #end
>        #if (RED = 1 & GREEN = 1 & BLUE  = 1)
>          #local RED   = 0.9;
>          #local GREEN = 0.9;
>          #local BLUE  = 0.9;
>        #end
>       color rgbt <RED, GREEN, BLUE, <%A%>>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Chris B wrote:
> >
> > "caduser" <nomail@nomail> wrote in message
> > news:web.4a588d74bddeda84dbd439ba0@news.povray.org...
> >> It seems if there is a way it would be the material file not the inc
> >> file right?
> >> When I tried my colleagues approach:
> >>
> >> <%MATERIAL
> >> texture {
> >>    pigment
> >>      {
> >>          color rgbt <<%R%> * 0.8 + 0.2,<%G%> * 0.8 + 0.2,<%B%> * 0.8 +
> >> 0.2,<%A%>>
> >>
> >>      }
> >> It did work for Black but shifts every color if there was a way at
> >> this point to
> >> just push one color value.
> >> I also need to look more at the reflectivity discussed early see if I
> >> can make
> >> Black reflect enough to not be pure black in the render.
> >>
> >
> > So did you try the other suggestions for your 'material' file (min, max
> > or clip)?
> > They would seem to be able to do exactly what you're asking for.
>
> I think he did not want to have colors change except pure Black/White.
>
> However, if the above syntax allows you to configure the output then
> it would seem you can insert arbitrary code into the SDL, e.g.,
>
> <%MATERIAL
>    texture {
>      pigment {
>        #local RED   = <%R%>;
>        #local GREEN = <%G%>;
>        #local BLUE  = <%B%>;
>        #if (RED = 0 & GREEN = 0 & BLUE  = 0)
>          #local RED   = 0.1;
>          #local GREEN = 0.1;
>          #local BLUE  = 0.1;
>        #end
>        #if (RED = 1 & GREEN = 1 & BLUE  = 1)
>          #local RED   = 0.9;
>          #local GREEN = 0.9;
>          #local BLUE  = 0.9;
>        #end
>       color rgbt <RED, GREEN, BLUE, <%A%>>
>
>       ...

Thanks Chris I will try both the Min Max and this latest suggestion, the min max
still has an effect on all the mid colors but if I understand this one it seems
it may work. I will try it this week and see what I get.


>You can use a single-line sed call (in unix like operating systems
>or wtih Cygwin in windows) to edit as many files you like in one go.
>
>E.g. like this:
>
>   sed -i 's/rgbt <0.,0.,0.,0.>/Gray20/' *.pov

As for multiple replaces that is nt a problem I have plenty of script or even
neat utilities like PSPad that can handle that but I don't want to produce them
all as it prevents me using teh program own batch render mechanism.


Post a reply to this message

From: Alain
Subject: Re: remap RGBT color to anther RGBT color?
Date: 11 Jul 2009 21:54:13
Message: <4a594245$1@news.povray.org>

> Christian Froeschlin <chr### [at] chrfrde> wrote:
> 

> It did work for Black but shifts every color if there was a way at this point to
> just push one color value.
> I also need to look more at the reflectivity discussed early see if I can make
> Black reflect enough to not be pure black in the render.
> 
> 
If you only add something like:

reflection 0.1

in the finish part, and there is something not black to reflect, the 
surface will be reflective enough to not be completely black.

If you are using some HDRI emulation that relies on many lights, then 
the best way may be the use of phong or specular highlight.

You could add something like this:

#default{ finish{ specular 0.1 roughness 0.0001 }}
//small = tight highlights
OR
#default{ finish{ phong 0.1 phong_size 200 }}
//LARGE = tight highlights

that will add some light specular highlight to every texture that don't 
have any specular/phong deffined.
This method is faster than reflections, as you don't have to shoot any 
additional rays to find what to reflect.


Alain


Post a reply to this message

From: Chris B
Subject: Re: remap RGBT color to anther RGBT color?
Date: 12 Jul 2009 04:03:01
Message: <4a5998b5@news.povray.org>
"caduser" <nomail@nomail> wrote in message 
news:web.4a592f0bbddeda84dbd439ba0@news.povray.org...

> Christian Froeschlin <chr### [at] chrfrde> wrote:
>> Chris B wrote:
>> > They would seem to be able to do exactly what you're asking for.
>>
>> I think he did not want to have colors change except pure Black/White.
>>
>
> Thanks Chris I will try both the Min Max and this latest suggestion, the 
> min max
> still has an effect on all the mid colors but if I understand this one it 
> seems
> it may work. I will try it this week and see what I get.
>

If you use a small value then the number of mid colors is very small (and 
possibly 0). The 'clip' syntax suggested by clipka is probably the most 
succinct:

color rgbt 
<clip(<%R%>,0.00001,0.99999),clip(<%G%>,0.00001,0.99999),clip(<%B%>,0.00001,0.99999),<%A%>>

Otherwise the syntax that Christian posted should give you a very precise 
control over the values.

Chris B.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.