POV-Ray : Newsgroups : povray.general : At-render texture blending Server Time
30 Jul 2024 06:24:51 EDT (-0400)
  At-render texture blending (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: SharkD
Subject: Re: At-render texture blending
Date: 29 Nov 2009 13:41:25
Message: <4b12c055$1@news.povray.org>
On 11/28/2009 2:14 PM, Siber wrote:
> The ships are UV mapped mesh2s exported from Wings3d.
> http://dl.dropbox.com/u/896078/UNH_FII.rar contains one such object and the
> textures that would go on it. http://dl.dropbox.com/u/896078/LoneInty.png is an
> example of the output, though in that the texture had been edited to include one
> of the player colors, while in the rar I have the layers separated

I was about to guess Homeworld 2! ;)

Oddly, I don't recognize that ship.


--
Michael Horvath
mik### [at] gmailcom
http://isometricland.com


Post a reply to this message

From: SharkD
Subject: Re: At-render texture blending
Date: 29 Nov 2009 13:43:33
Message: <4b12c0d5$1@news.povray.org>
On 11/28/2009 1:43 AM, Siber wrote:
> I am currently attempting to render certain ships in POV-ray that were
> originally intended for a game. In said game, regions of the ships are colored
> by the player's choice of fleet colors, and I would like to replicate this in
> the scene in such a way that I can specify these fleet colors in the scene, and
> not have to change them in an image editor.
>
> I have three textures, one for the plain texture and one for each of the two
> fleet colors, which are brighter where the color in question should be stronger,
> but I'm not sure how to get POV-ray to use this information the way I want it
> to. Any ideas?

Do the team stripe textures have an alpha channel? When you say they're 
"brighter", is this because of the alpha channel? If so then all you 
need to do is layer the textures on top of each other.


--
Michael Horvath
mik### [at] gmailcom
http://isometricland.com


Post a reply to this message

From: SharkD
Subject: Re: At-render texture blending
Date: 29 Nov 2009 13:51:24
Message: <4b12c2ac$1@news.povray.org>
On 11/29/2009 1:06 PM, Siber wrote:
> Sabrina is correct. Telling POV-ray what colors I want to use for a particular
> render isn't a problem, it's setting up the scene to use them that's being a
> problem.
>
> Since posting I have realized that one of the previous threads is indeed asking
> about what I want to do(and for similar ends judging by the provided examples),
> but I haven't been able to make the solutions provided there work for me. I can
> now tint an image a color, so I can take my black and white teamcolor and
> stripecolor images and make them whatever color I want, but composting them with
> the base color image eludes me.

Post an image showing the results you *are* getting.



--
Michael Horvath
mik### [at] gmailcom
http://isometricland.com


Post a reply to this message

From: Siber
Subject: Re: At-render texture blending
Date: 29 Nov 2009 14:10:01
Message: <web.4b12c659dd0a65f9ca9ceddd0@news.povray.org>
The ship is not from the game, it was produced as part of an ongoing
modification effort intended for them game

> Do the team stripe textures have an alpha channel? When you say they're
> "brighter", is this because of the alpha channel? If so then all you
> need to do is layer the textures on top of each other.

I had originally exported them simply as black and white images, white
representing where the color should be added. I have since put the information
in the alpha channel as well, in an attempt to get layering to work, but haven't
been successful in that yet.

I have not kept copies of all my efforts, so I can't really show you everything
I tried. I will try to do so going forward.


Post a reply to this message

From: Siber
Subject: Re: At-render texture blending
Date: 29 Nov 2009 15:25:00
Message: <web.4b12d7e2dd0a65f9ca9ceddd0@news.povray.org>
Figured out some things, but there are still some missing peices.

UV mapped textures can't be layered, but you can layer textures and then UV map
them only afterward. My ancient photoshop wasn't saving out the alpha channel,
but I found a format it would do so for. So now I can layer the textures
properly, but when I try to use the recoloring macro from the other thread on
the team and stripe layers, it errors out.

"Parse Error: No matching } in 'texture', macro identifier found instead"

This is with the exact same line that works if used in an unlayered texture by
itself. Not perfectly, however. When I test it on it's own, it appears to lose
it's transparency, which would make layering it somewhat useless.

In an attempt to help you help me, I've packaged all the necessary files here:
http://dl.dropbox.com/u/896078/UNH_FII.rar


Post a reply to this message

From: Reactor
Subject: Re: At-render texture blending
Date: 29 Nov 2009 16:20:01
Message: <web.4b12e525dd0a65f9ffc2ddb80@news.povray.org>
"Siber" <nomail@nomail> wrote:

> I had originally exported them simply as black and white images, white
> representing where the color should be added. I have since put the information
> in the alpha channel as well, in an attempt to get layering to work, but haven't
> been successful in that yet.




It sounds like you should be able to use the image_map as a pigment function,
then make the color_map match the colors you want.  I believe someone above
mentioned this, so here is some sample code:

//--------------
#declare ImageMap = function{
    pigment{
        image_map{
            "test.png"
            map_type 0
            interpolate 2
        }
    }
}


box{
    0, 1
    pigment{
        function{ ImageMap(x,y,z).gray }
        color_map{
        // color of the black areas of the image
        [0.00 color rgb <0.5,0.5,0.5> ]
        // color of the white areas of the image
        [1.00 color rgb <1.0,0.0,0.0> ]
            }
    }
}

//--------------

The image "test.png" is a grayscale png, and the color_map determines what the
actual colors will be.  You could use this in a layered pigment, and set some of
the colors to be transparent.  Alternatively, you could use this in a
pigment_map, and specify different pigments to be associated with the grayscale
range of the input image.

    HTH
 -Reactor


Post a reply to this message

From: Alain
Subject: Re: At-render texture blending
Date: 29 Nov 2009 16:41:20
Message: <4b12ea80$1@news.povray.org>

> "Siber" <nomail@nomail> wrote:
> 
>> I had originally exported them simply as black and white images, white
>> representing where the color should be added. I have since put the information
>> in the alpha channel as well, in an attempt to get layering to work, but haven't
>> been successful in that yet.
> 
> 
> 
> 
> It sounds like you should be able to use the image_map as a pigment function,
> then make the color_map match the colors you want.  I believe someone above
> mentioned this, so here is some sample code:
> 
> //--------------
> #declare ImageMap = function{
>     pigment{
>         image_map{
>             "test.png"
>             map_type 0
>             interpolate 2
>         }
>     }
> }
> 
> 
> box{
>     0, 1
>     pigment{
>         function{ ImageMap(x,y,z).gray }
>         color_map{
>         // color of the black areas of the image
>         [0.00 color rgb <0.5,0.5,0.5> ]
>         // color of the white areas of the image
>         [1.00 color rgb <1.0,0.0,0.0> ]
>             }
>     }
> }
> 
> //--------------
> 
> The image "test.png" is a grayscale png, and the color_map determines what the
> actual colors will be.  You could use this in a layered pigment, and set some of
> the colors to be transparent.  Alternatively, you could use this in a
> pigment_map, and specify different pigments to be associated with the grayscale
> range of the input image.
> 
>     HTH
>  -Reactor
> 
> 
You can even do this:

box{
     0, 1
     texture{
         function{ ImageMap(x,y,z).gray }
         texture_map{
         // Make the black areas glow with a bozo pattern
         [0.00 texture{ pigment{boso scale 0.1}finish{ambient 1 diffuse 
0}} ]
         // Make the white parts a red mirror
         [1.00 texture{ pigment{rgb <1.0,0.0,0.0>}finish{ambient 0 
diffuse 0.1 reflection 0.8}} ]
             }
     }
}



Alain


Post a reply to this message

From: Reactor
Subject: Re: At-render texture blending
Date: 29 Nov 2009 16:55:00
Message: <web.4b12ed6fdd0a65f9ffc2ddb80@news.povray.org>
"Siber" <nomail@nomail> wrote:
> Figured out some things, but there are still some missing peices.
>
> UV mapped textures can't be layered, but you can layer textures and then UV map
> them only afterward. My ancient photoshop wasn't saving out the alpha channel,
> but I found a format it would do so for. So now I can layer the textures
> properly, but when I try to use the recoloring macro from the other thread on
> the team and stripe layers, it errors out.
>
> "Parse Error: No matching } in 'texture', macro identifier found instead"
>
> This is with the exact same line that works if used in an unlayered texture by
> itself. Not perfectly, however. When I test it on it's own, it appears to lose
> it's transparency, which would make layering it somewhat useless.
>
> In an attempt to help you help me, I've packaged all the necessary files here:
> http://dl.dropbox.com/u/896078/UNH_FII.rar



I tried that and noticed that one of the files was named incorrectly -
UNH_FII_HULL_DIFFUSE.png was named UNH_FFI_HULL_DIFFUSE.png (note two 'F's
instead of two 'I's).  I renamed it and changed the wm_UNH_FII_HULL texture to
the function method I was describing:

//----------------- Begin Code:
#declare TEAMCOLOR = <1.0,0,0>;
#declare STRIPECOLOR = <0,0,1.0>;

#local TeamMap   = function { pigment{ image_map { "UNH_FII_HULL_TEAM.bmp"  } }
}
#local StripeMap = function { pigment{ image_map { "UNH_FII_HULL_STRIPE.bmp"} }
}


#declare wm_UNH_FII_HULL =
texture{ // underlying hull texture
     pigment{
         image_map{
             png "UNH_FII_HULL_DIFFUSE.png"
         }
     }
}
texture{ // Team colors
     pigment{
     function{ TeamMap(x,y,z).gray }
         color_map{
         [0.00 color rgbt 1 ]
         [1.00 color rgb TEAMCOLOR ]
             }
     }
}
texture{ // Stripe colors
     pigment{
     function{ StripeMap(x,y,z).gray }
         color_map{
         [0.00 color rgbt 1 ]
         [1.00 color rgbt STRIPECOLOR ]
             }
     }


     finish {
         ambient rgb <0.000000, 0.000000, 0.000000>
         diffuse 0.700000
         brilliance 1.000000
         metallic 0.000000
         specular 1.000000
         roughness 0.010000
     }
}

//----------------------
   -Reactor


Post a reply to this message

From: Siber
Subject: Re: At-render texture blending
Date: 29 Nov 2009 17:55:01
Message: <web.4b12fb02dd0a65f9ca9ceddd0@news.povray.org>
> I tried that and noticed that one of the files was named incorrectly -
> UNH_FII_HULL_DIFFUSE.png was named UNH_FFI_HULL_DIFFUSE.png (note two 'F's
> instead of two 'I's).  I renamed it and changed the wm_UNH_FII_HULL texture to
> the function method I was describing:

Oops, grabbed the wrong one. There is an FFI ship as well, and the textures
inhabit the same directory. Sorry about that

> Code

It works! Thank you so much!


Post a reply to this message

From: Thomas de Groot
Subject: Re: At-render texture blending
Date: 30 Nov 2009 03:17:53
Message: <4b137fb1@news.povray.org>
"Reactor" <rea### [at] hotmailcom> schreef in bericht 
news:web.4b10f729dd0a65f9d6eed2cf0@news.povray.org...
> Same idea, different implementation ;)
>

Sure! That was one step further :-)

Thomas


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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