POV-Ray : Newsgroups : povray.general : How to alter existing texture? Server Time
27 Dec 2024 20:43:30 EST (-0500)
  How to alter existing texture? (Message 1 to 4 of 4)  
From: Timothy Groves
Subject: How to alter existing texture?
Date: 19 Dec 2021 15:33:08
Message: <61bf9704$1@news.povray.org>
So I've been working with stones.inc, and using T_Stone29.  But for a 
portion of the object being modeled, I want to use the same texture, 
only darker.  Rather than hand-editing the entire texture, is there a 
quick and dirty way to say, "this texture, only darker?"


Post a reply to this message

From: Bald Eagle
Subject: Re: How to alter existing texture?
Date: 19 Dec 2021 17:30:00
Message: <web.61bfb1b6f25cddba1f9dae3025979125@news.povray.org>
Timothy Groves <tim### [at] gmailcom> wrote:
> So I've been working with stones.inc, and using T_Stone29.  But for a
> portion of the object being modeled, I want to use the same texture,
> only darker.  Rather than hand-editing the entire texture, is there a
> quick and dirty way to say, "this texture, only darker?"

There is not.   If you take a look at a very complex texture, there may be a lot
of different parts to it with many different pigments.   So it's impossible for
POV-Ray to "know" - or the developers to divine - which specific part you'd want
to tweak, or which parts should be tweaked.

What I and others normally do is copy-paste the desired texture definition into
your scene, or a separate include file, and then maybe invoke it as a macro.

You pass an argument or two to the the macro, and use that as a multiplier for
your pigment(s) in the texture definition.

That way you can just do something like:

object {myObject texture myTextureMacro (Shade1, Shade2)}

and then you can have multiple shades of the same texture at your fingertips any
time you like.

It's a PITA initially, but usually isn't _too_ hard to do.

See how I use the variable "Tone" as a multiplier:

http://news.povray.org/povray.text.scene-files/thread/%3Cweb.5ac57be22ec21c585cafe28e0%40news.povray.org%3E/

http://news.povray.org/povray.general/thread/%3C5abecb94%40news.povray.org%3E/?mtop=421797


Post a reply to this message

From: Kenneth
Subject: Re: How to alter existing texture?
Date: 20 Dec 2021 04:20:00
Message: <web.61c04a3bf25cddba4cef624e6e066e29@news.povray.org>
Timothy Groves <tim### [at] gmailcom> wrote:
> ...Rather than hand-editing the entire texture, is there a
> quick and dirty way to say, "this texture, only darker?"

I'm not *sure* that the following idea or exact syntax would work, but it's
worth a try.

For your 'darker' texture, pre-#declare it like this:

#declare T_Stone29_DARK =
texture{
     average
     texture_map{
          [1 T_Stone29]
          [1 pigment{rgb 0}] // simply black
                }
       }

Then you can vary the 'weight' of the black pigment in the average, to get a
darker shade of T_Stone29 (instead of 1, maybe 0.5, etc.) Then use both of the
#declared textures, in whatever way you need to, on the object.

I admit that this is a rather crude way of getting such a result.

Personally, I *would* hand-edit the original texture instead-- by simply
reducing its finish{diffuse...} value--  then re-#declare it as a separate
texture.


Post a reply to this message

From: Kenneth
Subject: Re: How to alter existing texture?
Date: 20 Dec 2021 05:40:00
Message: <web.61c05d57f25cddba4cef624e6e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
>
> Personally, I *would* hand-edit the original texture instead-- by simply
> reducing its finish{diffuse...} value--  then re-#declare it as a separate
> texture.

Well, I didn't actually *look* at the T_Stone29 texture in the 'stones2.inc'
include file, before commenting; I see now that it's a multi-part texture, and
with NO finish{...} block(s). So I guess it uses POV-Ray's default finish
attributes for its various textures.

SO... I thought that there might be an easy way to hand-edit T_Stone29, from
within your scene:

#declare T_Stone29_DARK =
texture{T_Stone29 finish{diffuse .5}} // or whatever darker finish you want

.... the idea being to override the default 'diffuse' values. However, this seems
to override the diffuse value in only the 3rd (final) texture of the three
textures in T_Stone29. So that's a non-starter :-/

It seems to me that 'stones2.inc' is inconsistent in its uses of finish{...}
statements. Personally, I would ADD finish{...} blocks to ALL of the textures
there, not just the few that have it.

-----
By the way: I also see that 'stones2.inc' does not even run in a scene without
'colors.inc' also being included-- because of a missing definition for the
'Clear' color which is defined in colors.inc.


Post a reply to this message

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