Jump to content

Concrete


DaJuice

Recommended Posts

First Post!!! :D

Ok, with that out of the way... here's an alternative to the concrete material available in VOPs. Feel free to modify it, upgrade it, add controls, whatever.

Quick notes: the shader uses the vector attribute 'edge_tint' if available (to darken the edges of geo tiles). It also uses a rest attribute for most stuff, so that you can randomize 'rest' (as shown in the SOP network) and create visible discontinuities in the larger noise from tile to tile. This shader does not require UVs.

About the format that we present these shaders in... anyone want to lay down some ground rules or should we just freestyle it for now?

Cheers!

post-37-1148618873_thumb.jpg

Concrete_1.0.zip

Link to comment
Share on other sites

omg thank you so much. I can see this forum really shining.

Great shader, mate. Now my characters have something to lean against.. or walk on :).

edit:// i dont see anything wrong with the way you presented the shader. Told us everything you need to know. Maybe just edit your first post if you update the shader.

Link to comment
Share on other sites

Yea man thats really nice.  Hey just wondering... I have my first Renderman class comming up next Quarter at SCAD... How much will that help me in VOPs??  Thanks for posting the file.

28037[/snapback]

If your Renderman class includes shaderwriting and doesnt only use slim you will gain a lot of knowledge that you can transfer to vops.

Sven

Link to comment
Share on other sites

Guest Guest

Nice work DaJuice! :thumbsup:

I haven't looked at it very closely, but here are a few quick first impressions:

- "Vex Specular" may not always be what you want (you may want OrenNayar for a "chalkier" cement, or a broad, slightly anisotropic specular highlight for example), so what do you think about splitting specular and diffuse and giving the user access to the different models/parameters?

Among other things, this would allow us to modulate Oren-to-Lambert by "painting" a bound "diff_rough" attribute (shader parm), which would break up the look more.

- Even if you don't split up the models, I don't think you want to have "evil" ambient hard-wired to 0.5. I'd suggest adding the "Ambient Color" of the lighting model as another parameter (and defaulting it to 1 so the user can control it implicitly by dimming an actual ambient light, which is the usual thing people do)... although, of course, ambient should be banned! :P

- Have you considered adding support for reflections?

Depending on how the cement is finished, it can be pretty reflective at grazing angles (and the bumps make that somewhat anisotropic, but I don't think you need to worry about that). Specular alone is not really suited for this kind of thing -- i.e: specularity from 5 point lights looks like exactly that: 5 bright spots.

- Just going by the parameters here: you have "diffuse brightness" but no "diffuse tint"... is that intentional?

... gotta get back to work...

Cheers!

Link to comment
Share on other sites

Oooops... that was me :rolleyes:

While I'm back here though, I just thought of something else (and this maybe should be part of the "guidelines":

Add export parameters for all the important parts of the shader calculation. For example, we have all our shaders export at the very least:

vector Cdiff (result of diffuse calc)

vector Cspec (result of specular calc)

float Kocc (weight form ambient occ if any)

vector Nbent (bent normal, if any)

etc, etc. Naming convensions is a separate topic, but you get the idea.

Link to comment
Share on other sites

Thanks all for the feedback.

- "Vex Specular" may not always be what you want (you may want OrenNayar for a "chalkier" cement, or a broad, slightly anisotropic specular highlight for example), so what do you think about splitting specular and diffuse and giving the user access to the different models/parameters?

Among other things, this would allow us to modulate Oren-to-Lambert by "painting" a bound "diff_rough" attribute (shader parm), which would break up the look more.

Good idea. Need to do this anyways to export diffuse and speculars.

- Even if you don't split up the models, I don't think you want to have "evil" ambient hard-wired to 0.5. I'd suggest adding the "Ambient Color" of the lighting model as another parameter (and defaulting it to 1 so the user can control it implicitly by dimming an actual ambient light, which is the usual thing people do)... although, of course, ambient should be banned!

Good point!! Doh! I never use ambient lights in my scenes so this completely slipped my mind. You're right, this won't do.

- Have you considered adding support for reflections?

Depending on how the cement is finished, it can be pretty reflective at grazing angles (and the bumps make that somewhat anisotropic, but I don't think you need to worry about that). Specular alone is not really suited for this kind of thing -- i.e: specularity from 5 point lights looks like exactly that: 5 bright spots.

Hadn't occured to me that concrete could sport reflections too. I'll add this as an option.

- Just going by the parameters here: you have "diffuse brightness" but no "diffuse tint"... is that intentional?

Yea, idunno what's up with that. If people want pink concrete they shall have it!! :D But yea, another thing to add. I'll take care of it later today.

Thanks for the guidelines Jason.

Cheers!

Link to comment
Share on other sites

Real nice shader. Makes for a convincing limestone as well.

I have a few comments on the shader.

- It is important that you keep the noises in the same shader space where it makes sense.

The dirt network's turbulent noise is being fed in global P with a space change to object while all the other noises are being fed from the Rest Position VOP which defaults to Texture space. Wire the output of the restpos1 Rest Position VOP in to the pos input of xform2 Transform VOP.

The problem is if you move the geometry inside the object, the dirt will slide but the concrete dimples will stick. can be confusing for the end user. Either move them all to object or to Rest/Texture.

You can read more about this in Texture and Modelling book Ch2: Texture Spaces. "The feature spaces should have a fixed relationship that doesn't change when the camera or the object moves."

- Keeping your shaders optimized is always a concern. You are using Transform VOPs to simply scale P by global_scale. These use matrix multiplication which can be expensive. You can safely replace xform1 and xform2 Transform VOPs with simple Multiply VOPs.

- Testing the rest position attribute on a primitive sphere is not very effective. Resting a single point leaves you with no surface texture. I usually test with NURBs spheres just for this very reason.

- When you mix more than two noise patterns together that may have high frequency content, you may get hit by aliasing issues (sparklies). Looking at your shader it isn't happening as the only real high frequency noises are in the aanoise1and aanoise3 VOPs. Then again, you don't know when the object isn't so big in frame. What seems like moderate frequency can turn to high.

It is quick and simple to try the animated camera test. Pick your camera and at frame one, zoom right in to one of the surfaces and set your keys. Move to say frame 100 and zoom right out so that the test scene is pretty small on the screen and give your camera a bit of a rotation in Z, say 180 degrees. Set the keys.

Now render a sequence and look for any sparkles.

Mixing two high frequency anti-aliased patterns together may cause aliasing. Sort of like trying to listen to two finely tuned radios where one is on a heavy classical piece and the other is on thrash metal. I have seen this with both texture maps (used as bump maps) and with procedurals (used to displace P or N) where both texture maps or noises had high frequency. Cranking shading quality to 2 or more is the only cure in these cases.

Link to comment
Share on other sites

Awesome, thanks for the great info old school. Good sh*t. :D

The shading space stuff kinda spun my head. I didn't consider that stuff might be animated at the SOP level. The only way to keep procedurals sticking to the geometry with SOP level animation is with a rest attribute then? Sorry if that seems dense. :unsure:

I have plugged the dirt to the rest attribute as well. Ideally I'd like the shader to be able to detect a second rest attrib (if present) and use that for the dirt instead. As I mentioned the rest attribute in the file is randomized for each tile, but I'd rather not have the dirt use a randomized rest. The pattern should be continous from tile to tile, though it doesn't look too bad right now.

- Keeping your shaders optimized is always a concern. You are using Transform VOPs to simply scale P by global_scale. These use matrix multiplication which can be expensive. You can safely replace xform1 and xform2 Transform VOPs with simple Multiply VOPs.

Thanks, won't forget that one. :)

- When you mix more than two noise patterns together that may have high frequency content, you may get hit by aliasing issues (sparklies). Looking at your shader it isn't happening as the only real high frequency noises are in the aanoise1and aanoise3 VOPs. Then again, you don't know when the object isn't so big in frame. What seems like moderate frequency can turn to high.

It is quick and simple to try the animated camera test. Pick your camera and at frame one, zoom right in to one of the surfaces and set your keys. Move to say frame 100 and zoom right out so that the test scene is pretty small on the screen and give your camera a bit of a rotation in Z, say 180 degrees. Set the keys.

Now render a sequence and look for any sparkles.

Mixing two high frequency anti-aliased patterns together may cause aliasing. Sort of like trying to listen to two finely tuned radios where one is on a heavy classical piece and the other is on thrash metal. I have seen this with both texture maps (used as bump maps) and with procedurals (used to displace P or N) where both texture maps or noises had high frequency. Cranking shading quality to 2 or more is the only cure in these cases.

Yup, familiar with this issue. The problem seems worst with very fine displacement. I will render out a sequence like you suggested and see how "safe" the default frequencies are.

In the meantime, here's the shader as it currently is. Hope I didn't make any major booboos. I added a bunch of controls, tidied some stuff up, commented a few nodes, and put in some exports. Not sure about weight form AO or bent normals, can someone explain those? Reflections also still need to be added. If you have any more suggestions I'd like to hear them, and you're of course free to tool around with it yourselves.

Concrete_1.1.zip

post-37-1148722704_thumb.jpg

Link to comment
Share on other sites

Yes i know the render problem, and i fixed it.

the problem was, i turned off, micro poly rendering in the render globals of mantra.

i turned it on, and all works fine.

.........crazy...........but it works.........

thanks for youre new shaderversion, i looks beautiful.

i hope i can test it, the next hours.

i see you gone a completely other way, to solve the reflexions problem.

thats fine. i love the vextree's.......i love houdini.........

Link to comment
Share on other sites

Wow, I'm gone for a week and a whole new forum pops up!

Cool cement shader - a great start to what I'm sure will be a very popular forum. It raises an interesting question - should there be a standard in place as to whether something like ambient occlusion should be shader-centric or light-centric? I've always been inclined to handle this from a light perspective so that I didn't have to include the routines in every shader.

Thoughts?

Link to comment
Share on other sites

Guest Guest
I've always been inclined to handle this from a light perspective so that I didn't have to include the routines in every shader.

Yeah, you could make it light-centric, but the problem is that bent normals and baked occlusion are both object-centric. What I ended up doing here, is adding a standard occlusion tab to all shaders. It can be set to either generate occlusion or read from baked files -- reason is that you don't want to be changing shaders just to generate baked occlusion for example.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...