POV-Ray : Newsgroups : povray.general : Override textures and materials? Server Time
26 Dec 2024 21:49:21 EST (-0500)
  Override textures and materials? (Message 1 to 10 of 22)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Mike Horvath
Subject: Override textures and materials?
Date: 15 Jan 2016 23:54:20
Message: <5699ccfc$1@news.povray.org>
Is there a way to force an override of preconfigured textures and 
materials of a scene? I would like to set the texture of my scene to a 
special texture used to render ChromaDepth 3D images. However, I don't 
want to go back and edit every single object in my scene. Thanks.


Mike


Post a reply to this message

From: Thomas de Groot
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 03:10:44
Message: <5699fb04$1@news.povray.org>
On 16-1-2016 5:54, Mike Horvath wrote:
> Is there a way to force an override of preconfigured textures and
> materials of a scene? I would like to set the texture of my scene to a
> special texture used to render ChromaDepth 3D images. However, I don't
> want to go back and edit every single object in my scene. Thanks.
>

My experience is that you will have to comment the old ones out or 
delete them. Later textures do not override previous ones in a scene file.

-- 
Thomas


Post a reply to this message

From: Stephen
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 04:42:37
Message: <569a108d$1@news.povray.org>
On 1/16/2016 8:10 AM, Thomas de Groot wrote:
> On 16-1-2016 5:54, Mike Horvath wrote:
>> Is there a way to force an override of preconfigured textures and
>> materials of a scene? I would like to set the texture of my scene to a
>> special texture used to render ChromaDepth 3D images. However, I don't
>> want to go back and edit every single object in my scene. Thanks.
>>
>
> My experience is that you will have to comment the old ones out or
> delete them. Later textures do not override previous ones in a scene file.
>
Are you sure about that Thomas?

I use Bishop3D which does not support PovRay 3.7. So if I want to use 
PovRay 3.7 textures I will use a 3.6 texture in the Bishop3D scene but 
redifine the tecture before the object is declared.

Sample code generated by Bishop3D.


#version 3.7;

global_settings {
adc_bailout       0.0039
ambient_light     rgb <1.000,1.000,1.000>
assumed_gamma     1 //2.200
irid_wavelength   rgb <0.250,0.180,0.140>
max_trace_level   5
number_of_waves   10
noise_generator   3
charset           ascii
}

background { color rgb <0.000,0.000,0.000> }

// 
****************************************************************************
// referenced scene items and forced visible scene items declaration begin
// 
****************************************************************************

#declare Shadow_Clouds_Mid =
pigment {
bozo
color_map {
[0.000 rgbft <0.850,0.850,0.850,0.000,0.000>]
[0.100 rgbft <0.750,0.750,0.750,0.000,0.000>]
[0.500 rgbft <1.000,1.000,1.000,0.000,1.000>]
}

rotate    <0.0,0.0,90.000>
rotate    <180.000,0.0,0.0>
scale     <1.000,6.000,6.000>
rotate    <-180.000,0.000,-90.000>
turbulence <0.650,0.650,0.650>
octaves 6
lambda 2.000
omega 0.700
}

#declare Shadow_Clouds_Bot =
pigment {
bozo
color_map {
[0.000 rgbft <0.850,0.850,0.850,0.000,0.000>]
[0.100 rgbft <0.750,0.750,0.750,0.000,0.000>]
[0.500 rgbft <1.000,1.000,1.000,0.000,1.000>]
}

rotate    <0.0,0.0,90.000>
rotate    <180.000,0.0,0.0>
scale     <1.000,6.000,6.000>
rotate    <-180.000,0.000,-90.000>
translate <0.000,-0.150,0.000>
turbulence <0.650,0.650,0.650>
octaves 6
lambda 2.000
omega 0.700
}

#declare Shadow_Clouds_Top =
pigment {
color rgbft <0.196,0.600,0.800,0.000,0.000>
}

#declare Red_Texture =
texture {
pigment {
color rgbft <1.000,0.000,0.000,0.000,0.000>
}

}

#declare Blue_White_Tiles2 =
texture {
checker
texture {
pigment {
color rgbft <1.000,1.000,1.000,0.000,0.000>
}

}

texture {
pigment {
color rgbft <0.000,0.502,1.000,0.000,0.000>
}

}

rotate    <0.0,0.0,180.000>
rotate    <-90.000,0.0,0.0>
scale     <-300.000,-300.000,-1000.000>
rotate    <90.000,0.000,-180.000>
rotate    <0.000,-180.000,0.000>
scale     <0.010,0.010,0.010>
}

#declare Camera0 =
camera {
perspective
location <-3.5,46.0,-195.0>
up y
right 1.333*x
angle 33.000
sky <0.0,1.0,0.0>
look_at < 0.000, 7.500, 0.000 >
}


// 
****************************************************************************
// referenced scene items and forced visible scene items declaration end
// 
****************************************************************************

union {
light_source {
< 0.00, 0.00, 0.00 >, color rgb <1.000,1.000,1.000>
fade_power 0.000
fade_distance 100.000
media_attenuation off
media_interaction on
translate <15.0,100.00,-200.0>
}

light_source {
< 0.00, 0.00, 0.00 >, color rgb <1.000,1.000,1.000>
fade_power 0.000
fade_distance 100.000
media_attenuation off
media_interaction on
translate <-25.0,55.0,-200.0>
}

}

sky_sphere {
pigment{ Shadow_Clouds_Top }
pigment{ Shadow_Clouds_Mid }
pigment{ Shadow_Clouds_Bot }

}

plane {
y , 0
texture{ Blue_White_Tiles2 }
scale     <10.00,1.00,10.00>
}


//------- Sphere0 Raw Script Begin -------
#declare Red_Texture =
texture {
   pigment {
     color rgbft <1.000,1.000,0.000,0.000,0.000>
   }

}

//------- Sphere0 Raw Script End ---------

sphere {
0.0, 1.00
texture{ Red_Texture }
scale     <5.954000,5.954000,5.954000>
rotate    <90.00,0.00,0.00>
translate <0.00,5.6490,0.00>
}


camera{ Camera0 }



-- 

Regards
     Stephen


Post a reply to this message

From: Kenneth
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 04:55:00
Message: <web.569a132a40a8aed333c457550@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:
> Is there a way to force an override of preconfigured textures and
> materials of a scene?
>

I agree, that would be a *really* useful feature in POV-Ray. I've had need of
something like what you've described; but as Thomas says, the only way at
present is to (tediously) edit the scene file, then add a #default texture to
apply to all the objects. Or else pre-plan the entire scene with your final
results in mind from the very beginning (which, I admit, usually isn't
practical, when the effect you're looking to create might simply be an
afterthought or a 'what-if' experiment!)


Post a reply to this message

From: Stephen
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 05:15:10
Message: <569a182e$1@news.povray.org>
On 1/16/2016 9:54 AM, Kenneth wrote:
> Mike Horvath <mik### [at] gmailcom> wrote:
>> Is there a way to force an override of preconfigured textures and
>> materials of a scene?
>>
>
> I agree, that would be a *really* useful feature in POV-Ray. I've had need of
> something like what you've described; but as Thomas says, the only way at
> present is to (tediously) edit the scene file, then add a #default texture to
> apply to all the objects. Or else pre-plan the entire scene with your final
> results in mind from the very beginning (which, I admit, usually isn't
> practical, when the effect you're looking to create might simply be an
> afterthought or a 'what-if' experiment!)
>
>
Why not put your textures in an INC file then you could put your 
alternative textures in another INC file. If they have the same names 
you can select which set of textures to use by using the #include command.

-- 

Regards
     Stephen


Post a reply to this message

From: Thomas de Groot
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 07:36:04
Message: <569a3934@news.povray.org>
On 16-1-2016 10:42, Stephen wrote:
> On 1/16/2016 8:10 AM, Thomas de Groot wrote:
>> On 16-1-2016 5:54, Mike Horvath wrote:
>>> Is there a way to force an override of preconfigured textures and
>>> materials of a scene? I would like to set the texture of my scene to a
>>> special texture used to render ChromaDepth 3D images. However, I don't
>>> want to go back and edit every single object in my scene. Thanks.
>>>
>>
>> My experience is that you will have to comment the old ones out or
>> delete them. Later textures do not override previous ones in a scene
>> file.
>>
> Are you sure about that Thomas?

Yes, when you have an object already textured to which you apply a 
second texture:

object{
   MyObject //with predefined texture
   texture {MyTexture}
}
This does not work.

>
> I use Bishop3D which does not support PovRay 3.7. So if I want to use
> PovRay 3.7 textures I will use a 3.6 texture in the Bishop3D scene but
> redifine the tecture before the object is declared.
>

You may get away with that provided you use identical texture names 
declared /before/ the object is opened/used.

As you say in answer to Kenneth, using an alternative texture file can 
do the trick, especially in typical mesh2 file builds.

#include "MyObjectTexture.inc"
#declare MyObject = mesh2{....}

As long as the texture names defined inside the alternative .inc file 
are identical to those defined inside the mesh2 file.

-- 
Thomas


Post a reply to this message

From: Mike Horvath
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 08:39:05
Message: <569a47f9$1@news.povray.org>
On 1/16/2016 5:15 AM, Stephen wrote:
> Why not put your textures in an INC file then you could put your
> alternative textures in another INC file. If they have the same names
> you can select which set of textures to use by using the #include command.
>

The problem in my case is that the individual textures are oriented to 
the local coordinates of each object, whereas I need a texture that is 
tied to the global coordinate system. I don't know how to compensate for 
this.


Mike


Post a reply to this message

From: Stephen
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 09:20:39
Message: <569a51b7@news.povray.org>
On 1/16/2016 1:39 PM, Mike Horvath wrote:
> On 1/16/2016 5:15 AM, Stephen wrote:
>> Why not put your textures in an INC file then you could put your
>> alternative textures in another INC file. If they have the same names
>> you can select which set of textures to use by using the #include
>> command.
>>
>
> The problem in my case is that the individual textures are oriented to
> the local coordinates of each object, whereas I need a texture that is
> tied to the global coordinate system. I don't know how to compensate for
> this.
>
>
> Mike

I misunderstood. I thought you wanted to swap between textures. Thomas 
was right. (As usual.)

I just had a quick look at what Chromadepth is and it looks quite 
interesting. Designing a scene where the depth information is in the 
colour will be, as I said, interesting. With red being in front, and 
blue being back.
I think you might be able to do it with a bit of jiggery pokery in the 
way you write your textures and scene.
I’ll dwell on’t. ;-)


-- 

Regards
     Stephen


Post a reply to this message

From: Sven Littkowski
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 13:10:05
Message: <569a877d$1@news.povray.org>
Mike, you mean something like discussed in the thread "NEW FEATURE:
Suggesting "aka" (Textures)" of the "p.beta-test" section of our
newsgroups here?


Post a reply to this message

From: Mike Horvath
Subject: Re: Override textures and materials?
Date: 16 Jan 2016 13:34:20
Message: <569a8d2c$1@news.povray.org>
On 1/16/2016 1:09 PM, Sven Littkowski wrote:
> Mike, you mean something like discussed in the thread "NEW FEATURE:
> Suggesting "aka" (Textures)" of the "p.beta-test" section of our
> newsgroups here?
>

I don't know... I wasn't able to understand your suggestion.

Is it possible to create an empty texture? In this case, I could swap 
out the current textures and instead apply one texture to the entire 
scene. Without too much effort on my part if it works.


Mike


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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