Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/w0097c3c/rs-forum/phpBB3/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3824: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3826: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3827: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3828: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:483)
Realsoft Forum • View topic - The library I'd like, and an analysis of Spotty

The library I'd like, and an analysis of Spotty

Moderator: Timo

The library I'd like, and an analysis of Spotty

Postby geo » Wednesday 1. September 2004, 23:54

Frank you obviously volunteer too much. I think I've started a new thread. The only book I had to read on hols said we would be much happier if we concentrated on our needs (or was it knees?) So this is what I'd included in a shader library - along with lots of shaders.

I wanted to make snow using Spotty ( the RS shader) for reflections, but I've had to analyse the thing to get the spots the way I'd like. I wrote out my analysis as I went. It's probably too brief as a primer on VSL, but for experienced folk it might help understand a new shader quicker. Maybe if there was a template that could be used, then sent to you for dead simple upload to a library?

Whatever. At least this post might help others understand Spotty. I dips me lid to the mind that thought of it.

Analysis of Spotty, a default VSL shader with Realsoft.

Description:
Makes spots of uniform colour, varying size, shape and density. The algorithm creates a vector that has a certain length at each point on the mapping, and that length determines the colour at that point. The trick is to create groupings of spots.

The six spheres in the picture show the value of the main vector variable assigned to the colour of the mapping point (don't know why it's disappeared for step 4?).


Variables:

vector coords
vector coords2
float r

1: coords=Linear(Map Coords) {for each point on the mapping the vector "coords" gets a scaled copy of the point's coordinates}

2: coords=Noise(coords) {Noise is added. You can see on the second sphere how it creates blobs if the output is set to colour.}

3: coords=coords+Scaled Map Coords {Scales coords to a bigger number}

4: Coords2=round(coords)
coords=coords-coords2 {with all the scaling going on, we have no idea of the value of the vector "coords". These two steps get them back between 0 and 1. E.g. if coords.x=4.2, coords2.x becomes 4, and therefore coords.x becomes 2 after the second step. In the default Spotty, a copy object is used for step 2, but you can also use a linear obect to assign the value to coords}

5: r=length(coords) {this operation finds the length of the vector coords. You can see on the sphere how the lengths blob around certain points}

6: if 0<r<0.4, colour the spot {you can see the correlation of colour to blobs in Sphere 5}
Attachments
spotty analysis out.jpg
spotty analysis out.jpg (22.5 KiB) Viewed 2275 times
geo
 
Posts: 150
Joined: Sunday 18. April 2004, 11:26

The snow

Postby geo » Wednesday 1. September 2004, 23:58

And here's the snow before I go. Spotty output is set to reflection.

I'll add a more flexible Spotty as well if I can add three attachments, or maybe in the next post

Geo.
Attachments
snow.jpg
snow.jpg (20.16 KiB) Viewed 2212 times
geo
 
Posts: 150
Joined: Sunday 18. April 2004, 11:26

Postby geo » Thursday 2. September 2004, 00:03

oh so totally brilliant - three pics all the same.

Sorry dudes. I probably can't attach a RS file, so will update tomorrow. So tired I'm making mistakes.

Adios
Geo :oops:
geo
 
Posts: 150
Joined: Sunday 18. April 2004, 11:26

Postby Timo » Thursday 28. October 2004, 18:29

(Sorry for the late answer)
This is pretty much what I wanted back when I was starting to learn VSL.
I wouldn't hurt to add such explanations to the manual for a few of the default materials.
Oh, edited the extra pics out just for fun... almost ended up deleting them all =P
Luckily I still had the pic in my cache.
When it is darkest, men see the stars.
User avatar
Timo
 
Posts: 468
Joined: Wednesday 6. August 2003, 21:24
Location: Helsinki, Finland


Return to Shader/VSL/Texturing

Who is online

Users browsing this forum: No registered users and 1 guest

cron