ashima / webgl-noise

Procedural Noise Shader Routines compatible with WebGL
MIT License
2.77k stars 300 forks source link

Procedural Focal Points #6

Closed Cat4D closed 12 years ago

Cat4D commented 12 years ago

Is there an option in the shader to indicate procedural focal points, where an offset is either a seed value or an attractor value, such as would be typical when replacing a textured object with have feature characteristics, or when extruding the procedural rendering along a non-uniform mesh structure, such as an extension object like flower or grass connected to the primary plane?

stegu commented 12 years ago

I'm not sure what you mean. There is certainly the option of doing such things in noise-based shaders, but what we provide is only the fundamentals, the noise basis functions. Thus, you need to find applicable examples of other people's work in procedural texturing and port it, or develop your own shader to do what you want. Unless I read you all wrong, what you want seems to involve manipulation of texture coordinates rather than the noise function itself.

Some of what you want may be possible to do with pre-computed distance fields to get detailed feature-driven control over texture coordinates. Some details on that are presented on: http://contourtextures.wikidot.com/

/Stefan G

Cat4D commented 12 years ago

A technological demonstration that I think everyone would like to see, would include a fully GPU based noise generator for each of the following together: Terrain displacement, Terrain color texture, optional terrain bump, optional noise for grass-wave-displacement, (grass generator), and another texture layer-- possibly just an alpha, for expansion. This would help demonstrate the application of GPU functions for complex environment generation including grass and hair, simply providing the poly structure for the terrain/surface and its grass/features, coloration, etc, eliminating the need to load textures from webgl. A best visual might include the grass component of a field of brush fire.

The focal points, or fixed seed values, would help dictate a procedural characteristic bound to the resulting texture coordinate, allowing for a fixed color or seed value at a known position when using a standard object, for example a creatures' eyes or face which might desire either a set color/pattern variation or otherwise the opposite to include fixed endpoints and wide range of variation in the rest of the procedurally generated texture surface or object...

stegu commented 12 years ago

OK, I agree that would be way cool, but we're hoping for others to create applications with these tools. If I did it, it would probably not be very impressive in terms of artistry. We did the noise functions, and I think we did them well. Their application is probably better left for others to develop. Neither of us are experienced shader artists - we just dabble in the art.

The seeds or focal points you speak of are something that is more closely related to texture layer blending than noise generation as such. Perlin noise is basically featureless and agnostic about context, unless you play tricks with texcoord distortion or blending. It's a simple procedural primitive that is evaluated on a point by point basis, not at all like a simulation where you can place various constraints for the equation solver to take into account. (My apologies if I misunderstand you here.)

/Stefan