POV-Ray : Newsgroups : povray.newusers : Texture declarations and object grouping Server Time
5 Sep 2024 14:17:36 EDT (-0400)
  Texture declarations and object grouping (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: The Cegorach
Subject: Re: Texture declarations and object grouping
Date: 5 Feb 2001 11:07:38
Message: <mvjt7t4phlh7iuqbp1v9dqi4valbb8j912@4ax.com>
On Mon, 5 Feb 2001 14:50:37 -0000, "Tom Melly" <tom### [at] tomandlucouk>
wrote:

>Well, I've run a quick test using the code below and moving the texture
>parts from one place to another.
>
>It is quicker to place your texture definitions as "late" as possible (i.e.
>against the union rather than the object). This is only an issue with
>parse-time, since the code is plainly quicker to execute (less texture
>definitions to parse). Render time is unaffected, since the final scene is
>the same.

Is parse time typically a big concern?  

Thanks for the quick response.

Cordially,
Larry


Post a reply to this message

From: Tom Melly
Subject: Re: Texture declarations and object grouping
Date: 5 Feb 2001 11:28:42
Message: <3a7ed4ba$1@news.povray.org>
"The Cegorach" <ceg### [at] yahoocom> wrote in message
news:mvjt7t4phlh7iuqbp1v9dqi4valbb8j912@4ax.com...
> On Mon, 5 Feb 2001 14:50:37 -0000, "Tom Melly" <tom### [at] tomandlucouk>
> wrote:
>
>
> Is parse time typically a big concern?
>

For me, no (unless I'm rendering a mesh exported from poser on my P90 at
home).


Post a reply to this message

From: Margus Ramst
Subject: Re: Texture declarations and object grouping
Date: 5 Feb 2001 13:11:45
Message: <3A7EED78.3AF1188A@peak.edu.ee>
The Cegorach wrote:
> 
> Is there any advantage to grouping all of the columns around a
> particular building in one declared group, and defining their texture
> at that group level, as opposed to leaving the texture declaration
> within the declaration of "Column?"
> 

As Tom said, there might be some advantage in parse time (and memory usage).
However, bear in mind that the two methods usually do not yield identical
results.
If you declare the object with a texture and then create multiple copies of this
object, the texture of each copy is transformed (moved, rotated, scaled) along
with the copy itself.
If you first create the copies and then apply the texture to the whole group,
the texture location remains the same for all copies.

In other words, the first scenario is equivalent to:

object{
  MyObject
  texture{MyTexture}
  transform{MyTransform}
}

The second scenario is equivalent to:

object{
  MyObject
  transform{MyTransform}
  texture{MyTexture}
}

With most organic textures, like stones etc, it probably won't matter. But if
you need precise control over the placement of the texture relative to the
object (such as with an image_map), it makes sense to texture first and
transform later.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

From: Tom Melly
Subject: Re: Texture declarations and object grouping
Date: 5 Feb 2001 14:57:09
Message: <3a7f0595$1@news.povray.org>
"Margus Ramst" <mar### [at] peakeduee> wrote in message
news:3A7EED78.3AF1188A@peak.edu.ee...
> The Cegorach wrote:

> However, bear in mind that the two methods usually do not yield identical
> results.

Yes - I thought of mentioning this. Actually, I thought of it the other way
around - if you're creating "natural" objects, such as columns that have
been weathered, then generally it makes sense to position your objects first
and texture later otherwise it can be very obvious that similiar objects are
using identical patterns, so:

union{
    object{my_column}
    translate <A,B,C>
    texture{my_column_texture}
}

rather than

union{
    object{my_column}
    texture{my_column_texture}
    translate <A,B,C>
}


Post a reply to this message

From: Margus Ramst
Subject: Re: Texture declarations and object grouping
Date: 5 Feb 2001 15:42:40
Message: <3A7F10D8.D81FFB69@peak.edu.ee>
Tom Melly wrote:
> 
> Yes - I thought of mentioning this. Actually, I thought of it the other way
> around - if you're creating "natural" objects, such as columns that have
> been weathered, then generally it makes sense to position your objects first
> and texture later otherwise it can be very obvious that similiar objects are
> using identical patterns, so:
> 

Actually, even in this case I often texture each object separately, and then
apply some (e.g. random) transformation to the texture itself.
Otherwise, especially if the texture pattern is somewhat regular (e.g. marble
bands) and two objects are close (e.g. a set of marble tiles), you run the risk
of having the texture noticeably "continue" from one object to the next.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

From: David Fontaine
Subject: Re: Texture declarations and object grouping
Date: 5 Feb 2001 18:23:33
Message: <3A7F35CE.BD19AA75@faricy.net>
There will probably be a memory usage advantage to texturing the group.
There may be a slight parse time advantage. I do not believe there should
be any render time advantage. (Unless your scene makes POV access memory
a hell of a lot, since RAM is slower than CPU. ;)

There is an important diference, however. If you texture the item itself
and copy it, they will be identically textured. Discerning and nitpicky
people tend to frown on that. If you texture as a group however, each
column will have its own little section of the texture. The best solution
would be to have a macro that creates a slightly randomized texture every
time you want a pillar, but don't worry about that kind of stuff yet. :O

Note that for pillars, which probably don't touch, the group method is
fine, but if you have something made out of smaller objects (like a wood
floor) you would not want to do that, as it would look like one giant
piece of wood! (Yeah, so I used to do that in my old scenes... hey, shut
up :)

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: The Cegorach
Subject: Re: Texture declarations and object grouping
Date: 6 Feb 2001 21:47:09
Message: <lrd18t0oim4s4qt00leqg1emloi4f97q0i@4ax.com>
On Mon, 05 Feb 2001 17:22:55 -0600, David Fontaine <dav### [at] faricynet>
wrote:

>There is an important diference, however. If you texture the item itself
>and copy it, they will be identically textured. Discerning and nitpicky
>people tend to frown on that. 

Indeed, that was going to be my *next* question; i.e., why are all my
pillars identically textured?  Thanks also to Margus and Tom for
pointing this out.  

Thanks,
Larry


Post a reply to this message

From: The Cegorach
Subject: Re: Texture declarations and object grouping
Date: 6 Feb 2001 21:50:02
Message: <a2e18tsfr93762o69mu3498gju9r2gicnj@4ax.com>
On Mon, 05 Feb 2001 22:45:12 +0200, Margus Ramst <mar### [at] peakeduee>
wrote:

>Actually, even in this case I often texture each object separately, and then
>apply some (e.g. random) transformation to the texture itself.
>Otherwise, especially if the texture pattern is somewhat regular (e.g. marble
>bands) and two objects are close (e.g. a set of marble tiles), you run the risk
>of having the texture noticeably "continue" from one object to the next.

Thanks to both you and Tom for your help.

When you speak of random transformations, is this achieved by a
function with POV-Ray, such as a Do/While loop, or do you do it by
hand?

I ask because I'm currently working on--you guessed--marble pillars.
:-)

Thanks,
Larry


Post a reply to this message

From: Gail Shaw
Subject: Re: Texture declarations and object grouping
Date: 7 Feb 2001 00:53:47
Message: <3a80e2eb@news.povray.org>
The Cegorach <ceg### [at] yahoocom> wrote in message
news:a2e18tsfr93762o69mu3498gju9r2gicnj@4ax.com...
>
> When you speak of random transformations, is this achieved by a
> function with POV-Ray, such as a Do/While loop, or do you do it by
> hand?

I tend to use something like :

#declare rndTex=seed(4834);

texture {My_Marble_Texture translate
<100*rand(rnd),100*rand(rnd),100*rand(rnd)>}

Check the docs on seed and rand if not familiar with them

> I ask because I'm currently working on--you guessed--marble pillars.
> :-)

Granite pillars here, and just about finished.

Gail
********************************************************************
* gsh### [at] monotixcoza              * System.dat not found.         *
* http://www.rucus.ru.ac.za/~gail/ * Reformat hard drive Y)es O)k  *
********************************************************************
* If at first you don't succeed, call it version 1.0               *
********************************************************************


Post a reply to this message

From: Margus Ramst
Subject: Re: Texture declarations and object grouping
Date: 7 Feb 2001 10:28:37
Message: <3A816A41.E8CA931E@peak.edu.ee>
The Cegorach wrote:
> 
> When you speak of random transformations, is this achieved by a
> function with POV-Ray, such as a Do/While loop, or do you do it by
> hand?
> 

Certainly not by hand, I hate manual labour :P
POV has a rand() function, you can use this to create random transformation
vectors (as in Gail's example).
If the pillars are placed regularly, you can create them with a while loop; each
time the parser goes through the loop and encounters the rand() function, a
different random number is created (ranging from 0 to 1).
Of course you can also position the pillars by hand and give a random texture
transformation to each copy separately.
Here are two macros you might find useful (the second needs access to the first
one to run):

//Give a random number of given mean and maximum deviation
//M - mean value
//D - maximum deviation
//Seed - (declared) random number seed identifier
#macro rand_ext(M,D,Seed)
        (M+(rand(Seed)-.5)*2*D)
#end

//Give a random vector of given mean and max deviation
//M - mean (vector/float)
//D - max deviation (vector/float)
//Seed - (declared) random number seed identifier
#macro v_rand_ext(M,D,Seed)
        #local MV=M+<0,0,0>;
        #local DV=D+<0,0,0>;
       
(<rand_ext(MV.x,DV.x,Seed),rand_ext(MV.y,DV.y,Seed),rand_ext(MV.z,DV.z,Seed)>)
#end


-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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