POV-Ray : Newsgroups : povray.general : At-render texture blending Server Time
26 Nov 2024 20:32:20 EST (-0500)
  At-render texture blending (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Siber
Subject: At-render texture blending
Date: 28 Nov 2009 01:45:01
Message: <web.4b10c6a969fb4644ca9ceddd0@news.povray.org>
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?


Post a reply to this message

From: Siber
Subject: Re: At-render texture blending
Date: 28 Nov 2009 02:30:00
Message: <web.4b10d174dd0a65f9ca9ceddd0@news.povray.org>
Oops. May have put this in the wrong section. Sorry if so.


Post a reply to this message

From: Thomas de Groot
Subject: Re: At-render texture blending
Date: 28 Nov 2009 03:29:19
Message: <4b10df5f$1@news.povray.org>
"Siber" <nomail@nomail> schreef in bericht 
news:web.4b10c6a969fb4644ca9ceddd0@news.povray.org...
>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?
>
>

I suppose you could do this for instance:

#declare P = texture {plain code};
#declare F1 = texture {fleet1 code};
#declare F2 = texture {fleet2 code};

#declare Plain is on;
#declare Fleet1 = on;

in the appropriate parts of the ship(s) you state:

#if  (Plain)
  texture {P}
#else
  #if (Fleet1)
    texture {F1}
  #else
    texture {F2}
  #end
#end

Hope this helps

Thomas


Post a reply to this message

From: PM 2Ring
Subject: Re: At-render texture blending
Date: 28 Nov 2009 03:35:01
Message: <web.4b10dfe6dd0a65f9f4c648ed0@news.povray.org>
"Siber" <nomail@nomail> 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?

You can probably do this easily in POV-Ray, using pigment_map or texture_map. Or
even just with layered pigments. What form are these ship objects in? Are they
meshes, or are they built with more traditional POV-Ray components?

Maybe you should post a small scene to show us what you mean. It can be so easy
to misinterpret a written description. :)


Post a reply to this message

From: Reactor
Subject: Re: At-render texture blending
Date: 28 Nov 2009 05:15:01
Message: <web.4b10f729dd0a65f9d6eed2cf0@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote:
>
> I suppose you could do this for instance:
>
> #declare P = texture {plain code};
> #declare F1 = texture {fleet1 code};
> #declare F2 = texture {fleet2 code};
>
> #declare Plain is on;
> #declare Fleet1 = on;
>

> I suppose you could do this for instance:
>
> #declare P = texture {plain code};
> #declare F1 = texture {fleet1 code};
> #declare F2 = texture {fleet2 code};



But what if there will be more fleets in the future??

#declare TextureList = array[3]
{
texture { /* plain code  */ },
texture { /* fleet1 code */ },
texture { /* fleet2 code */ }
}

#declare FleetNumber = 1; // 0 would be plain, 1 would be fleet1, etc


Then, in the ships:
object{
    Ship
    texture{ TextureList[FleetNumber] }
}


Same idea, different implementation ;)

-Reactor


Post a reply to this message

From: Siber
Subject: Re: At-render texture blending
Date: 28 Nov 2009 14:15:00
Message: <web.4b117697dd0a65f9ca9ceddd0@news.povray.org>
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 believe there is some misunderstanding. I don't have a set of pre-colored
textures I wish to switch between, that is in actuality just what I'm trying to
avoid. What I would like to do is tell POV-ray to do something along the lines
of the following:

Take texture1, and for the pixels that correspond with white pixels in texture2,
blend with colorA. Take the resulting image, and for the pixels that correspond
with white pixels in texture3, blend with colorB. Take the result and use it as
a texture on an object.

In this way I could recreate any color choice a player might make for their
fleet, of which there are 65 thousand options, by only changing some values in
POV-ray rather than by going into an image editor and doing it by hand for each
of the several ships I might want to include in the scene.


Post a reply to this message

From: Alain
Subject: Re: At-render texture blending
Date: 28 Nov 2009 22:00:06
Message: <4b11e3b6$1@news.povray.org>

> 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 believe there is some misunderstanding. I don't have a set of pre-colored
> textures I wish to switch between, that is in actuality just what I'm trying to
> avoid. What I would like to do is tell POV-ray to do something along the lines
> of the following:
> 
> Take texture1, and for the pixels that correspond with white pixels in texture2,
> blend with colorA. Take the resulting image, and for the pixels that correspond
> with white pixels in texture3, blend with colorB. Take the result and use it as
> a texture on an object.
> 
> In this way I could recreate any color choice a player might make for their
> fleet, of which there are 65 thousand options, by only changing some values in
> POV-ray rather than by going into an image editor and doing it by hand for each
> of the several ships I might want to include in the scene.
> 
> 

It's possible to set many variable from the command line options.
You can have a section at the top of the source POV file where you have 
a bunch of #declare where you can set your parameters.
You can have an INI file that sets/choose the desired 
colours/textures/images.
You can use a random stream to chose those same parameters. Great if you 
want a scene with 100 personalised ships. Just use a loop that randomly 
change the colours options for each ship.

You can have a collection of badges and insignas images that can be 
passed that way. A command line set variable, or ini file set variable, 
can then be used to chose a given image to be applied as an image_map.

You can use palleted image format (16 or 256 colours BMP, gif, PNG,...) 
and use a color_map to give any index any new value of your choosing, 
you can even use texture_map and replace specific colour with any 
pattern. Again, you can pass those via the command line.

You can use a few arrays of colours, or textures, and use some variable 
to chose some specific sets.

Toggether, those can enable you to create billions of different 
coulour/texture shemes. How about a differently decorated ship for each 
resident of the planet...?



Alain


Post a reply to this message

From: Sabrina Kilian
Subject: Re: At-render texture blending
Date: 29 Nov 2009 04:14:04
Message: <4b123b5c$1@news.povray.org>
Alain wrote:
> You can use palleted image format (16 or 256 colours BMP, gif, PNG,...)
> and use a color_map to give any index any new value of your choosing,
> you can even use texture_map and replace specific colour with any
> pattern. Again, you can pass those via the command line.
> 
> You can use a few arrays of colours, or textures, and use some variable
> to chose some specific sets.

If I read correctly, that is what he is looking to do. Take the image
texture already in existence and replace certain colors with other ones
at render time.

Siber, you might take a look back at an older thread on how to convert
an image to a function, and then use that function to create the new
pigment_map. See
http://news.povray.org/povray.advanced-users/thread/%3C45031f15@news.povray.org%3E/?mtop=5

I would try to offer code myself, but I just hack at textures till they
look right, someone else can probably offer some better advice.


Post a reply to this message

From: Alain
Subject: Re: At-render texture blending
Date: 29 Nov 2009 11:00:46
Message: <4b129aae$1@news.povray.org>

> Alain wrote:
>> You can use palleted image format (16 or 256 colours BMP, gif, PNG,...)
>> and use a color_map to give any index any new value of your choosing,
>> you can even use texture_map and replace specific colour with any
>> pattern. Again, you can pass those via the command line.
>>
>> You can use a few arrays of colours, or textures, and use some variable
>> to chose some specific sets.
> 
> If I read correctly, that is what he is looking to do. Take the image
> texture already in existence and replace certain colors with other ones
> at render time.
> 
> Siber, you might take a look back at an older thread on how to convert
> an image to a function, and then use that function to create the new
> pigment_map. See
>
http://news.povray.org/povray.advanced-users/thread/%3C45031f15@news.povray.org%3E/?mtop=5
> 
> I would try to offer code myself, but I just hack at textures till they
> look right, someone else can probably offer some better advice.

The options I offered are render time.
You set some variables, then you render.

Your option can be used as a post process, done by POV-Ray, or can be 
used to alter some image to be image maped on the model.



Alain


Post a reply to this message

From: Siber
Subject: Re: At-render texture blending
Date: 29 Nov 2009 13:10:00
Message: <web.4b12b83add0a65f9ca9ceddd0@news.povray.org>
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 a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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