Procedural Materials in real time with Pixel Shader 3.0?

Repran

Newcomer
Hi all,

One of the advantages of Pixel Shader 3.0 is claimed to be "Allows more complex shading, lighting, and procedural materials" (see http://www.microsoft.com/whdc/winhec/partners/shadermodel30_NVIDIA.mspx)

I was intriged by the possibilities of proceduarl textures in real time, yet a search for how to render procedural materials did not yield any results.

Can someone point me to a basic introduction on how to render procedural materials in real time with pixel shader 3.0?

Would also be happy about a link to an in depth pixel shader tutorial.

Thanks!

Steve
 
Well by materials they mean well procedual colouring of surfaces.

You could do something like this pseudo code

Shader XYZ( TextureCord IN1 )
{
// Get the X and Y components of the texture cordinates
float x = IN1.x;
float y = IN1.y;

// this creats a sort of wavey red/green/yellow/black colouring
return RGBA( sin( x ) , cos ( y ) , float( 0.0 ) , float ( 0. ) );

}

Now of course this is a pretty pathetic example but you can do things such as fractals or noise functions which can take either a large number of instructions OR a large number of exectuded instructions ( looping ).
 
You could do a form of procedural texturing (in real time) in DX6/7.
 
Thaks for the answer, but this is not what I am looking for.

I know procedural textures are 'easy'. But when I say procedural materials I mean texture plus surface structure. Example: tree bark has a destinkt texture but also a very distinct 3d surface structure that would be impractical - to put it mildely - to represent in polygons.

Or: rough stone, turtle shell, orange skin etc.

Thanks!
 
You mean some kind of displacement or bump mapping alongside the generated texture? Rather like, I guess, a material has in a 3D package?
 
Repran said:
Thaks for the answer, but this is not what I am looking for.

I know procedural textures are 'easy'. But when I say procedural materials I mean texture plus surface structure. Example: tree bark has a destinkt texture but also a very distinct 3d surface structure that would be impractical - to put it mildely - to represent in polygons.

Or: rough stone, turtle shell, orange skin etc.

Thanks!

Nah you can't do that with PS3.0 you can't do real procedual geometry without full blowning raytracing.

Now in VS4.0 you should be able to do tesslate triangles and stuff hopefully this will be powerful enough for what you want.

Also you could do a render to texture of a procedual hieght map texture and then use the texture to do a DX9 Displacement map ( can have an adaptive LOD) or use VS3.0 textures to modify pre-tesslated geometry. Or you could use create procedual hieght map equation and couple that with parralex mapping.
 
Repran said:
Hi all,

One of the advantages of Pixel Shader 3.0 is claimed to be "Allows more complex shading, lighting, and procedural materials" (see http://www.microsoft.com/whdc/winhec/partners/shadermodel30_NVIDIA.mspx)

I was intriged by the possibilities of proceduarl textures in real time, yet a search for how to render procedural materials did not yield any results.

Can someone point me to a basic introduction on how to render procedural materials in real time with pixel shader 3.0?

Would also be happy about a link to an in depth pixel shader tutorial.

Thanks!

Steve

Just look at ShaderMark v2.0 wood, stone and tile shader....

pic_14.jpg

pic_13.jpg

pic_15.jpg


You don't need 3.0 shaders for proc. textures.

Thomas
 
Bloodbob: That sounds really interesting. Can you direct me to some in depth reading on what will be possible with PS/VS 4.0?

Also: Procedural geometry will not be necessary. Just procedural normal/height maps for high detail per pixel lightning. Same thing, just different representation of info. Right?

tb: Yes - procedural textures - but how about procedural materials (including height maps and surface normals)?
 
Repran said:
Bloodbob: That sounds really interesting. Can you direct me to some in depth reading on what will be possible with PS/VS 4.0?

Also: Procedural geometry will not be necessary. Just procedural normal/height maps for high detail per pixel lightning. Same thing, just different representation of info. Right?

tb: Yes - procedural textures - but how about procedural materials (including height maps and surface normals)?

Most procedural materials will be done via procedural textures + procedural normal maps - it's cheaper to have detailed textures, then detailed geometry.
Even with vs/ps 3.0 you need high tesselated geometry to apply high maps(displacement mapping and other effects).... With vs/ps 4.0 we will get a geometry unit, which can create vertieces....

Thomas
 
Hmm - I guess what I should have really asked is: can normal and height maps be generated procedurally on-the-fly as a texture can by the GPU?
 
i don't really get your problem. we have shaders. they allow full runtime generation of each pixel on your surface. that means full procedural materials of certain complexity. the more the hw advances, the more freedom it allows. but everything combined, evaluated, and calculated runtime _IS_ procedural. in that way, even q1 with lightmaps on the surfaces had sort of procedural generated wall-light interaction.

of course, you can generate all sort of data runtime, it's just a mather of generating the right final pixel. some things get stored in textures, to look it up, some things are calculated realtime. with ps2.0 (and before, too, but first time really with quite complex shaders, and full range values), we have fully programable/procedural materials.

a material by itself isn't much. it's only much in interaction with light. and due that, all, _ALL_ material done with todays per pixel lighting _IS_ procedural. even if its just some lookups into some textures. and of course, you can do other stuff than sampling info from textures, as much as fits into a shader.
 
Repran said:
Hmm - I guess what I should have really asked is: can normal and height maps be generated procedurally on-the-fly as a texture can by the GPU?

Yes.
 
Any resources available online that I can study to get me started?

Google (surprisingly) wasn't very helpfull.

Thanks!
 
Back
Top