POV-Ray : Newsgroups : povray.general : Modifying an image_map color? : Re: Modifying an image_map color? Server Time
30 Jul 2024 04:24:35 EDT (-0400)
  Re: Modifying an image_map color?  
From: CShake
Date: 15 Oct 2009 10:43:09
Message: <4ad734fd$1@news.povray.org>
Christian Froeschlin wrote:
> CShake wrote:
> 
>> Is there any way to do this in povray, without having to manually edit 
>> the .tga files in gimp/photoshop?
> 
> You can convert between pigments and functions, which should allow
> you to do arbitrary color transformations on an image_map, e.g.
> 
> #macro from_black(COLOR)
> color_map
> {
>   [0 color rgb 0]
>   [1 color COLOR]
> }
> #end
> 
> #macro pigment_scale(PIGMENT, SCALE)
> #local F = function { pigment {PIGMENT} }
> #local R = pigment {function {F(x,y,z).red}   from_black(3*SCALE*Red)  }
> #local G = pigment {function {F(x,y,z).green} from_black(3*SCALE*Green)}
> #local B = pigment {function {F(x,y,z).blue}  from_black(3*SCALE*Blue) }
> pigment {average pigment_map {[R] [G] [B]} }
> #end

Thanks, this seems to work perfectly. More code than I anticipated, but 
oh well. I'll have to see if I can modify the exporter to allow for it 
natively.

A new issue I'm finding is that all the uv_mapping textures seem to be 
mirrored in either u or v , so I'm having to go through and scale them 
with a bit of trial and error. I'm assuming this is the fault of the 
exporter not doing the right-handed coordinated (milkshape) to 
left-handed (povray) correctly.
I'm not holding my breath, but could there be a way of not needing to do 
this by hand, either through scaling the mesh or something? It seems 
that whichever direction is closest to being in-line with z (either u or 
v) needs to be mirrored for the texture to work correctly.


Post a reply to this message

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