POV-Ray : Newsgroups : povray.general : Did I miss anything? (parent/child texture in CSG) Server Time
30 Dec 2024 11:47:42 EST (-0500)
  Did I miss anything? (parent/child texture in CSG) (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Ilya Razmanov
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 31 Jan 2024 11:25:28
Message: <65ba7478$1@news.povray.org>
On 31.01.2024 17:42, Bald Eagle wrote:

> Excellent.   This is very cool.  :)
> 
> More please!

Long ago I did something for textile simulation using normal 2D approach 
(well, more like 2.5D), but it went to people who paid for it. But now, 
with CPU speed drastically improved, chances are I can use 3D for this.

But so far prototype is full of junk, and I have next to no idea how to 
simulate irregular displacement.

But anyway, I'll share it on my github place when I remove all the junk 
I can find and add something looking more interesting than plane plastic 
wire. This grid is typical to linen, for example, but I need linen 
texture for it.

What as to textures, surely, I can decompose whole object down to thors, 
sorry, as you were, tori (damn it, aren't tori some sort of gates in 
Japan? anyway, I mean plural for donut) and assign anything necessary to 
each of them separately, but it will make development and especially 
debugging somewhat more complicated.

Ilyich the Toad
https://github.com/Dnyarri/


Post a reply to this message

From: William F Pokorny
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 1 Feb 2024 00:37:47
Message: <65bb2e2b$1@news.povray.org>
On 1/31/24 08:14, Ilya Razmanov wrote:
> Any chances I can have it?

The usual way is to use the fast path texture element overrides.

//---
...
#declare Fn00 = function { pattern { spiral1 12 scale 1/6} }
#declare Fn01 = function { pattern { wrinkles scale 1/99 } }
#declare Tor00 = torus {
     0.5, 0.15
     // What follows are overrides of the default texture's
     // three components - creating a new texture for Tor00.
     pigment { White }
     normal {
         function { (Fn00(-x,y,z)+Fn01(x,y,z)*0.2)/1.2 }
         bump_size +0.67 rotate x*90
         accuracy 0.005
     }
     finish { ambient 0.0 brilliance 1.5 }
}

object { Tor00 } // White around origin.

// White on left side of image
union {
     object { Tor00 translate y*-0.7 }
     object { Tor00 translate y*+0.7 }
     pigment { Green } // Ignored where objects are textured.
     translate (x+z)*-1.25
}

// Following is a way to override just the pigment component
// of the texture already on Tor00.
union {
     object { Tor00 pigment { Green } translate y*-0.7 }
     object { Tor00 pigment { Red }   translate y*+0.7 }
     translate (x+z)*+1.25
}
...
//---

There are limitations to the approach where the texture{}s are 
non-simple (ie layered) or a material{} is used.

Bill P.


Aside: Remember how in v3.8 beta2 is spiral1 is really spiral2 due a 
typo? Well, I coded a v3.7 version for posting here after my yuqk 
version (where spiral1 is spiral1) and, dang if doesn't look like the 
rotate of the spiral has been flipped in yuqk / v3.8? relative to v3.7.
I don't think this something I did, but suppose I might have to create
a fixed version of v3.8 beta 2 to be sure...


Post a reply to this message


Attachments:
Download 'keepnormal.jpg' (51 KB)

Preview of image 'keepnormal.jpg'
keepnormal.jpg


 

From: Bald Eagle
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 1 Feb 2024 07:20:00
Message: <web.65bb8c5dd90d9b2b1f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> The usual way is to use the fast path texture element overrides.

> // Following is a way to override just the pigment component
> // of the texture already on Tor00.


> There are limitations to the approach where the texture{}s are
> non-simple (ie layered) or a material{} is used.

I always thought that once the object was textured, it was fixed, and could not
be overridden.  This has been discussed in the past, so I'm surprised.  I also
do a lot of scenes where I have some objects in a union textured/pigmented and
then the union gets a texture/pigment, and only the default textured objects get
the union texture.


> Aside: Remember how in v3.8 beta2 is spiral1 is really spiral2 due a
> typo? Well, I coded a v3.7 version for posting here after my yuqk
> version (where spiral1 is spiral1) and, dang if doesn't look like the
> rotate of the spiral has been flipped in yuqk / v3.8? relative to v3.7.
> I don't think this something I did, but suppose I might have to create
> a fixed version of v3.8 beta 2 to be sure...

I thought you had fixed the uv-mapping of the torus, so that it's consistent
with all of the other primitives, and not backwards anymore.  Does that have
anything to do with it?  (probably not, but...)

- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 1 Feb 2024 08:19:55
Message: <65bb9a7b$1@news.povray.org>
On 2/1/24 07:19, Bald Eagle wrote:
> I always thought that once the object was textured, it was fixed, and could not
> be overridden.  This has been discussed in the past, so I'm surprised.  I also
> do a lot of scenes where I have some objects in a union textured/pigmented and
> then the union gets a texture/pigment, and only the default textured objects get
> the union texture.

It can be confusing and we're not helped due some of the documentation 
being misleading.

Internally what happens is things not explicitly textured with 
texture{}(s) / material{} or by creating a texture via one of the fast 
path / shorthand texture component texture specifications, like a not 
texture{} wrapped color or pigment{} block specification, are not 
textured at all until a post process step of the parsing.

In that post step the parent 'stuff' which exists is pushed down onto 
the children - or the default texture gets applied - where there isn't 
already 'stuff'. (lying a little)

The thing about the fast path texture component methods is they 
sometimes assign the default texture and modify a particular component 
of it. Or, they modify a particular component of the existing attached 
texture. Supposing an already textured Tor00 and Tor01 with no texture.

object { Tor00 pigment{...} } // Modifies the already attached texture.
object { Tor01 pigment{...} } // Modifies / applies default texture

object { Tor00
// Replaces attached texture with modified, default texture. The
// texture{} wrap without a passed texture ID always starts with the
// default texture.
   texture { pigment {...} }
}

Aside: Good memory on the torus uv mapping! :-) One of the three forms 
was mistakenly created right handed. I do still flip it to left handed 
as I recall in the yuqk code. The official v3.8 POV-Ray releases left 
the mapping code as is. At the moment, not sure how it could be related, 
but maybe? I'm in the middle of some other code work, so the 
investigation on the spiral 1 & 2  won't happen for a while.

Bill P.


Post a reply to this message

From: Ilya Razmanov
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 8 Feb 2024 04:01:20
Message: <65c49860$1@news.povray.org>
On 01.02.2024 8:37, William F Pokorny wrote:
> On 1/31/24 08:14, Ilya Razmanov wrote:
>> Any chances I can have it?
> 
> The usual way is to use the fast path texture element overrides.
> 
> //---
> ...
> #declare Fn00 = function { pattern { spiral1 12 scale 1/6} }
> #declare Fn01 = function { pattern { wrinkles scale 1/99 } }

Sorry for extremely dumb question but I'm too slow and looks like I'm 
missing something.

It seems like people are capable to define procedural, that is, 
algorithmic textures and stuff (for example, normals), to be calculated 
by POVRay internally, to be used in scenes. I mean defining them as some 
sort of non-POVRay-specific built-in functions but rather as some 
general math function similar to that in general programming languages.

I, however, am unable to find any understandable docs regarding this. I 
guess I'm completely wrong somewhere - asking wrong questions, searching 
in wrong places, etc. Any ideas regarding what may be the right place to 
get something to read?

Ilyich the Toad


Post a reply to this message

From: Bald Eagle
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 8 Feb 2024 07:25:00
Message: <web.65c4c7e3d90d9b2b1f9dae3025979125@news.povray.org>
Ilya Razmanov <ily### [at] gmailcom> wrote:

> It seems like people are capable to define procedural, that is,
> algorithmic textures and stuff (for example, normals), to be calculated
> by POVRay internally, to be used in scenes.

Welcome to functions!

https://wiki.povray.org/content/Reference:Function

"Declaring User-Defined Color Functions
Right now you may only declare color functions using one of the special function
types. The only supported type is the pigment function. You may use every valid
pigment. This is a very simple example:

#declare foo = function {
  pigment {
    color red 1
    }
  }

#declare Vec = foo(1,2,3)
An example using a pattern:

#declare foo = function {
  pigment {
    crackle
    color_map {
      [0.3, color Red]
      [1.0, color Blue]
      }
    }
  }"


Post a reply to this message

From: William F Pokorny
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 12 Feb 2024 20:14:14
Message: <65cac266$1@news.povray.org>
On 2/8/24 04:01, Ilya Razmanov wrote:
> Any ideas regarding what may be the right place to get something to read?

Glad Bill W got you started with answers.

I'd add that a look at the documentation for isosurface and parametric 
surfaces - which are based on functions - might help. There are user 
defined pigments, densities, cameras possible too with examples. You can 
search the shipped example scenes for 'function'. Of course patterns and 
their modifiers are more or less functions of a sort too.

Ah, and you can look at the functions.inc include itself for 
descriptions of the inbuilt functions and their parameters in official 
releases of POV-Ray. I think a rough copy of the documentation therein 
is include somewhere in the official web documentation too. The warning 
I'd give is not all of the function.inc function and parameter 
description are accurate - it something seems really confusing, it might 
be a documentation mismatch. It is what is.

As for a really good, all in one tutorial, Mike Williams published what 
I think was the best one for functions and isosurfaces / parametrics. It 
was one from which I learned a lot, but the web site is no longer 
active. The wayback machine has a copy and, IIRC, Bill W (or someone) 
put a copy of a lot of it somewhere accessible?

I'm attaching scene and image output file. The scene started with Mike's 
cylcoords.pov from that tutorial - which I modified somewhat as the 
attached version given you were working some with textured torus 
objects. Once the base shape is in place, it's possible to get many 
different looks by changing parameters to the component functions. I 
often find it fun to just push parameters around and render repeatedly 
just looking at what appears in the final render.

Aside: My yuqk fork differs substantially with respect to built in 
functions and the interplay between patterns and functions - and I'm 
still hacking on the inbuilt code quite a bit. I don't have ready 
documentation which relates well to official POV-Ray releases. Yuqk's 
documentation for concepts sometimes OK, but particulars will often be 
different.

Bill P.


Post a reply to this message


Attachments:
Download 'cylcoords1.jpg' (98 KB) Download 'cylcoords1.pov.txt' (2 KB)

Preview of image 'cylcoords1.jpg'
cylcoords1.jpg

From: Bald Eagle
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 13 Feb 2024 06:35:00
Message: <web.65cb5338d90d9b2b1f9dae3025979125@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:

> As for a really good, all in one tutorial, Mike Williams published what
> I think was the best one for functions and isosurfaces / parametrics. It
> was one from which I learned a lot, but the web site is no longer
> active. The wayback machine has a copy and, IIRC, Bill W (or someone)
> put a copy of a lot of it somewhere accessible?

Thanks for the reminder.
I just sent him a copy.

I think the document (pdf) is ~4mb, and the zip is 176 kb.
Perhaps we can find a spot to host the files?   The Wiki?
A link from the main page?   References?

- BW


Post a reply to this message

From: William F Pokorny
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 14 Feb 2024 07:16:50
Message: <65ccaf32$1@news.povray.org>
On 2/13/24 06:32, Bald Eagle wrote:
> I think the document (pdf) is ~4mb, and the zip is 176 kb.
> Perhaps we can find a spot to host the files?   The Wiki?
> A link from the main page?   References?

I have in my head someone already posted copies of the tutorial...

The fastest is probably to post a tarball to povray.binary.tutorials. 
And, there they are!

---
Pekka Aho in May 2021:

https://news.povray.org/povray.binaries.tutorials/thread/%3Cweb.609fe84ffb749b2cbac92b0947dba873%40news.povray.org%3E/

---
yesbird, a year ago in February of 2023 created and posted alternate web 
sites:

http://news.povray.org/povray.binaries.tutorials/thread/%3C63f215a6%241%40news.povray.org%3E/

For browsing:
https://povlab.online/isotutorial/

Archived:
https://povlab.online/arc/iso_tut.zip

Source is here:
http://web.archive.org/web/20190728000430/http://www.econym.demon.co.uk/isotut/index.htm
--
YB

(I'll make a note in my local - somewhat hacked up - version of the 
examples from that tutorial so hopefully I see it next time I dive in 
there for something.)


======
Aside: When I posted the modified version of cylcoords.pov as 
cylcoords1.pov a thing that bothered me was the hard coded compensation 
scaling for the twist distortion. I'd worked out a formula years ago, 
but couldn't remember it (or find it) in the moment. Playing around some 
I came up with '(1/Turns)*(1/R2)', which I think was it..? So instead of

-----------------------------------------*
f_helix1(x,z,y, Strands, +Turns, R1, R2, 1, 0.8, -20)

this is likely better:

-----------------------------------------****************
f_helix1(x,z,y, Strands, +Turns, R1, R2, (1/Turns)*(1/R2), 0.8, -20)

Note! The formula works less well with other than spherical / near 
spherical base shapes. The base positions also start somewhat twisted 
according to the thread, which doesn't matter for a spherical base 
shape, but it does to some amount otherwise.

With that formula in place and using a pure sphere base (0.8 --> 1.0), 
some might find setting Turns to something like 1/1000 interesting. It's 
possible to get quite a few interesting shapes - not helix like - out of 
the f_helix1() function!

For fun, another image using the compensation formula.

Bill P.


Post a reply to this message


Attachments:
Download 'cylcoords_canvasa.jpg' (175 KB)

Preview of image 'cylcoords_canvasa.jpg'
cylcoords_canvasa.jpg


 

From: Ilya Razmanov
Subject: Re: Did I miss anything? (parent/child texture in CSG)
Date: 19 Feb 2024 06:40:40
Message: <65d33e38$1@news.povray.org>
On 13.02.2024 4:14, William F Pokorny wrote:
> On 2/8/24 04:01, Ilya Razmanov wrote:
>> Any ideas regarding what may be the right place to get something to read?
> 
> Glad Bill W got you started with answers.
> 
> I'd add that a look at the documentation for isosurface and parametric 
> surfaces - which are based on functions - might help. There are user 

Thanks everybody, now I seem to have more than enough for my old brain 
to digest, so you are unlikely to be bothered by me for quite a while 
(unless, of course, I come up with more questions).

Ilya Razmanov
https://github.com/Dnyarri/


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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