POV-Ray : Newsgroups : povray.newusers : bicubic patch editor Server Time
12 Apr 2025 17:40:17 EDT (-0400)
  bicubic patch editor (Message 29 to 38 of 38)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 10:05:00
Message: <web.67ed434141fe04425b4de9225979125@news.povray.org>
"gulino" <nomail@nomail> wrote:
> Thanks for the help but what exactly is this? I was aiming to make a grass
> texture like this

I'm just getting the functions to work without any errors.
Scale the functions so that they make something along the lines of what you
want.

Do that by multiplying or dividing the x, y, and z in the function call.

You may find Mike Williams' isosurface tutorial helpful with regard to working
with functions in POV-Ray.
https://wiki.povray.org/content/User:BillW

Also, as jr said, if you can't get the function or the normal method to work,
then you can use a set of macros to model actual blades of grass to better give
you what you're looking for.

Also, like jr said, you have 30 years of people writing and posting scenes here.
Search for "grass", "landscape", "heightfield", etc and see what pops up.
Use the website search feature, but also use a search engine to see what people
have done and have posted elsewhere.



- BW


Post a reply to this message

From: gulino
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 11:25:00
Message: <web.67ed55bb41fe044264ac0beab67afd2@news.povray.org>
What you think? Looks grass?


Post a reply to this message


Attachments:
Download 'plainpov (2).png' (108 KB)

Preview of image 'plainpov (2).png'
plainpov (2).png


 

From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 11:45:00
Message: <web.67ed5b2d41fe04425b4de9225979125@news.povray.org>
"gulino" <nomail@nomail> wrote:
> What you think? Looks grass?

It does - now maybe rather than just a green pigment, you can use a pigment
pattern like "bozo" and a color map that fades from green to yellowish-green, to
give some variety to the scene.

Then you can add a few isosurface boulders jutting up out of the ground, some
trees, a gradient sky_sphere (or an HDR light probe), trees...

I think you'll enjoy building it up piece by piece.

- BW


Post a reply to this message

From: MichaelJF
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 14:36:46
Message: <67ed83be$1@news.povray.org>
Am 02.04.2025 um 17:20 schrieb gulino:
> What you think? Looks grass?
It looks like a well-tended green and would make a beautiful golf 
course. If you want to model a steppe, a prairie or a Spanish dehesa 
(that's what your picture reminds me most of), the grass texture should 
be randomly disturbed, for example by the bozo or the agate pattern as 
Bald Eagle suggested.

IMO you're making good progress.

Best regards
Michael


Post a reply to this message

From: gulino
Subject: Re: bicubic patch editor
Date: 3 Apr 2025 10:30:00
Message: <web.67ee9b6041fe044264ac0beab67afd2@news.povray.org>
Bozo instead of gradient y
I think before was better

pigment {
        bozo scale 3 turbulence .9
        pigment_map {
            [0.00 color rgb <0.3, 0.5, 0.0>]
            [0.50 color rgb <0.3, 0.6, 0.0>]
            [1.00 color rgb <0.3, 0.7, 0.0>]
        }
    }


Post a reply to this message


Attachments:
Download 'plainpov.png' (77 KB)

Preview of image 'plainpov.png'
plainpov.png


 

From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 3 Apr 2025 10:55:00
Message: <web.67eea0cf41fe04452b3ee0425979125@news.povray.org>
"gulino" <nomail@nomail> wrote:
> Bozo instead of gradient y
> I think before was better
>
> pigment {
>         bozo scale 3 turbulence .9
>         pigment_map {
>             [0.00 color rgb <0.3, 0.5, 0.0>]
>             [0.50 color rgb <0.3, 0.6, 0.0>]
>             [1.00 color rgb <0.3, 0.7, 0.0>]
>         }
>     }

It all comes down to what you want it to look like, and what you're going to add
to it.

Suggestions for experiments to explore:

1. Layered textures.
You can do things like object {MyObject texture {Texture1} texture {Texture2}}
and Texture2 will be "on top of" Texture1 like a layer of paint over a coat of
primer.
If your Texture2 has rgbt 1 as an entry, it will be clear, and you can then see
Texture1.  That way you can keep your old grass texture and add some yellowish
stuff on top of it - but not everywhere.

2. uv_mapping
you can take textures or images and paste them onto your surface in a way that
follows the surface rather than being dependent on the <x, y, z> coordinates of
the space where your object's surface is at.

3. "Planting"
you can learn how to use the trace () function to "scan" the heightfield surface
and place an upright thin cylinder at the exact "ground level" at that location.
 Lots little green cylinders will add a grass effect.  Adding a gradient with
yellow at the top, and it might look even better.   Do the narrow triangle thing
like jr suggested, and it's more grass-blade like.  Rotate them so that they
lean, and then randomly rotate their orientation, and it makes for more
"realism".
(Also, since you have a function generating your height_field, you can skip
trace () altogether and just use the y-value of your function at that <x, z>
location.)

- BW


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: bicubic patch editor
Date: 3 Apr 2025 19:30:00
Message: <web.67ef19a941fe04443a63f5189db30a9@news.povray.org>
Hi Gulino

Below is my suggestion for some code for you to start with.

The grass-like "texture" is made like Bald Eagle suggested,
but the shape of the terrain is made with a sum of some simpler
f_noise3d() functions at different sample frequencies.

--
Tor Olav
http://subcube.com
https://github.com/t-o-k


// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#version 3.7;

#include "functions.inc"
#include "colors.inc"

global_settings {
    assumed_gamma 1.0
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

#declare GrassFn =
    function {
        pattern {
            bumps
            scale <1.0e-8, 1.0, 1.0e-8>
        }
    }
;

// Frequency multipliers
#declare Ma = pow(2, 0);
#declare Mb = pow(2, 1);
#declare Mc = pow(2, 2);
#declare Md = pow(2, 3);

// Noise sampling offsets
#declare Ya =  0.0;
#declare Yb = -1.2; // +2.0
#declare Yc =  0.0;
#declare Yd =  0.0;

#declare FnA = function { f_noise3d(Ma*x, Ya, Ma*z) };
#declare FnB = function { f_noise3d(Mb*x, Yb, Mb*z) };
#declare FnC = function { f_noise3d(Mc*x, Yc, Mc*z) };
#declare FnD = function { f_noise3d(Md*x, Yd, Md*z) };

// Frequency amplitudes
#declare Ka = 0.0;
#declare Kb = 2.0;
#declare Kc = 0.3; // 1.6
#declare Kd = 0.1;

#declare GrassHeight = 0.04;

#declare K = 1.0 + Ka + Kb + Kc + Kd + GrassHeight;

#declare TerrainFn =
    function {
        (
            1.0*y
            + Ka*FnA(x, 0.0, z)
            + Kb*FnB(x, 0.0, z)
            + Kc*FnC(x, 0.0, z)
            + Kd*FnD(x, 0.0, z)
            + GrassHeight*GrassFn(x, 0.0, z)
        )/K // To avoid "wrap around"
    }
;

union {
    height_field {
        function 1000, 1000 { TerrainFn(x, 0.0, 1.0 - y) }
        smooth
        pigment {
            function { FnC(x, 0, z) }
            color_map {
                [ 0.1 color rgb <1.0, 0.7, 0.0> ]
                [ 0.6 color rgb <0.3, 0.5, 0.0> ]
            }
        }
        // pigment { color rgb <0.6, 0.8, 0.0> }
        // no_shadow
    }
    union {
        #for (X, 0, 1, 1/32)
            #for (Z, 0, 1, 1/32)
                #declare Y = TerrainFn(X, 0, Z);
                sphere { <X, Y, Z>, 0.005 }
            #end // for
        #end // for
        pigment { color White }
    }
    translate -<1, 0, 1>/2
    scale 1000*<1, 1, 1>
}

box {
    <-1e8, -10, -1e8>, <+1e8, 0, +1e8>
    pigment { color SeaGreen }
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7

sky_sphere {
    pigment { color SkyBlue }
}

light_source {
    1e8*<-2, +1, -7>
    color White
}

#declare AspectRatio = image_width/image_height;

camera {
    right AspectRatio*x
    location < 0, +700, -1400>*0.8
    look_at < 0,  +450,  0>
    // angle 40
}

// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7


Post a reply to this message

From: William F Pokorny
Subject: Re: bicubic patch editor
Date: 3 Apr 2025 22:53:30
Message: <67ef49aa$1@news.povray.org>
On 4/3/25 19:28, Tor Olav Kristensen wrote:
> The grass-like "texture" is made like Bald Eagle suggested,
> but the shape of the terrain is made with a sum of some simpler
> f_noise3d() functions at different sample frequencies.

Neat!

(Did you intend for Ka to be zero?)

Forgive me for running a yuqk experiment with your scene. I couldn't 
resist given your code.

In the yuqk fork, all the inbuilt functions support noise generator 
selection with an extra parameter - where the underlying code supports 
multiple noise generators.

Attached an image using noise generators 1,2 and 3 top sub-image, downward.

In the bottom sub-image I use all three noise generators in combination(*).

I did not change the 'bumps pattern' noise generator, so it's always 2.

Bill P.

(*) - The idea - hard coded too in yuqk's experimental, f_granite23() 
inbuilt function - uses noise generators in combination. One, so the 
buckles which are sometimes visible are much less likely to be, visible. 
Two, with the thought the result might look different / interesting - 
less like the usual noise based results.


Post a reply to this message


Attachments:
Download 'torolavterraingrass_ngs.jpg' (94 KB)

Preview of image 'torolavterraingrass_ngs.jpg'
torolavterraingrass_ngs.jpg


 

From: gulino
Subject: Re: bicubic patch editor
Date: 5 Apr 2025 17:20:00
Message: <web.67f19d6741fe044264ac0beab67afd2@news.povray.org>
Thank you but I will try other things for now, I tried doing a tree but it
didn't work out very well...


Post a reply to this message


Attachments:
Download 'capt181003.png' (378 KB)

Preview of image 'capt181003.png'
capt181003.png


 

From: Alain Martel
Subject: Re: bicubic patch editor
Date: 8 Apr 2025 14:33:10
Message: <67f56be6$1@news.povray.org>
Le 2025-04-05 à 17:15, gulino a écrit :
> Thank you but I will try other things for now, I tried doing a tree but it
> didn't work out very well...

You could try with 1 to 3 other spheres inside that one, bound in an 
union and the texture applied at once.

Should be acceptable when viewed from a distance.
Closer ones having more spheres than the farther ones.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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