Apply a surface material to everything in camera view?

zigraphixzigraphix Posts: 2,787

I seem to recall a mention on the old board of a way to apply surface material settings to everything in the camera view, something like adding a Surface root to a Camera shader. Every time I try that, I crash DS. Was I completely misunderstanding that there was such a capability?

The reason I'm asking is that most of the "Geometry" bricks either won't hook up to an Imager root, or cause a crash on attempt to render, often with an error like

3Delight message #145 (Severity 1): S2073: 'SceneMin' is not a parameter of shader 'brickyard/{f3eb71f3-b546-44ee-bca1-1be75c26bfc5}/shader_Imager'

But I know, for example, that there ought to be a way to make a camera that assigns a grayscale value based on depth. And I'm pretty sure there ought to be a way to assign a value based on normal direction-- not as slick as the multipass outline I've been working on, but perhaps nice for some purposes.

Any suggestions?

Comments

  • zigraphixzigraphix Posts: 2,787
    edited December 1969

    Does anyone know if this kind of thing would be covered in the 3Delight or Renderman docs, and if so, where in those docs I might look? I'm not sure what the root nodes look like in RSL, but if anyone knows of an RSL camera shader that does something like this, I might be able to figure out a few more steps than I currently have....

  • zigraphixzigraphix Posts: 2,787
    edited December 1969

    I came across this and thought someone else might find it helpful:

    http://www.vga.hr/resources/tutorials/3d/rsl/html/chapter_01.htm

    Surface shaders -Surface shaders are attached to geometry. These shaders describe optical properties of geometric object. Simply said, Surface shaders tells the renderer what will the surface look like when it is hit by the light. Consider this shader, as the one that describes what will the object look like

    Displacement shaders - These shaders change the topology of the surface. In order to change the topology, Displacement shader can do one of two things. It can do REAL displacement, which moves the actual geometry, or it can move the surface normals, which produce the infamous BUMP effect. These shaders are also attached to the geometry.

    Volume shaders - Volume shader changes the color of the light ray as it travels through volume. Volume can be one of several things. For one, it can be geometry. If light ray travels through geometry and it has volume shader attached, this shader will modulate light ray's color in a way you've described in shader. Secondly, volume can be light item. This means that you can have, for example, Spot Light's cone represent the volume through which light ray's will be modulated by a volume shader (volumetric lights). As for the third type of volume, if volume shader isn't attached to anything, it will be considered as atmospheric volume shader. Consider fog, myst and similar effects.

    Light shaders - This shader represents the light source. With light shader you describe the emission of light rays from the source (item that has the light shader attached) to the destination point, which is the surface being illuminated. These shaders generally give control over light color, shadows, intensity, falloff with distance, barn doors etc. Light shaders are shaders with which you control light sources. Important to note is that light source to which this shader can be attached to is either light item or geometry.

    Imager Shaders - Imager shaders operate on image just prior to the final output. When renderer is finished with calculating pixel colors for the image output, this shader operates on these pixels. Look at this kind of shaders as MAX Render Effects. It's a post-process shader, but with access to scene data (just like MAX Render Effects).

    This doesn't answer my question of the day, but it helps put some of the other docs I'm reading into context.

  • mjc1016mjc1016 Posts: 15,001
    edited September 2012

    zigraphix said:
    But I know, for example, that there ought to be a way to make a camera that assigns a grayscale value based on depth. And I'm pretty sure there ought to be a way to assign a value based on normal direction-- not as slick as the multipass outline I've been working on, but perhaps nice for some purposes.

    Any suggestions?

    Wasn't that covered or something similar in the long thread on depth cue cameras.

    http://forumarchive.daz3d.com/viewtopic.php?p=1924514#1924514

    You need to change the forum.daz3d to forumarchive.daz3d to get any of the links to work


    http://forumarchive.daz3d.com/viewtopic.php?t=116624

    I just posted a thread with the links working in that compiled link list of Pen's...

    http://www.daz3d.com/forums/discussion/8482/

    Post edited by mjc1016 on
  • zigraphixzigraphix Posts: 2,787
    edited September 2012

    The depth camera info is there, thanks, but my question about surfaces is not in that thread or the one immediately linked. JustTheBast referred to it here:

    http://forumarchive.daz3d.com/viewtopic.php?p=3073138#3073138

    I do know that you can put a surface or volume root brick (with or without an attached network) into the camera shader, and their result will be applied to all surfaces the camera sees.

    But I've never seen a working example of a Surface root node in a camera shader. Whenever I try it, either DS crashes, or the render generates an error that prevents any further rendering until DS is restarted.

    I used a Google site:forumarchive.daz3d.com search to see if I could find any other references to specifying surface parameters in a camera, but failed.

    Post edited by zigraphix on
  • zigraphixzigraphix Posts: 2,787
    edited December 1969

    So I spent the evening experimenting with volume roots in camera shaders. No crashes, but I can't get Edge Blend or Toon Outline to create any effect in the image. :( I tried feeding different variables in to see if it just needed an array of points or something like that, but no luck. Then I tried a series of vector math attempts with normal, I, E, etc., and got nowhere with any of that, either.

    Pendraia had an Edge Blend/Toon Outline shader with a Volume root working in an earlier version (.37? Does that sound right?) but I had a later version at that time, and couldn't get it to work. Now I'm left wondering if the effect Pen got was due to a bug, or if there's a bug now.... :-S

  • almahiedraalmahiedra Posts: 1,352
    edited December 1969

    zigraphix said:
    So I spent the evening experimenting with volume roots in camera shaders. No crashes, but I can't get Edge Blend or Toon Outline to create any effect in the image. :( I tried feeding different variables in to see if it just needed an array of points or something like that, but no luck. Then I tried a series of vector math attempts with normal, I, E, etc., and got nowhere with any of that, either.

    Pendraia had an Edge Blend/Toon Outline shader with a Volume root working in an earlier version (.37? Does that sound right?) but I had a later version at that time, and couldn't get it to work. Now I'm left wondering if the effect Pen got was due to a bug, or if there's a bug now.... :-S

    Did you try space transform? I had problems with my outline, but with the appropriate transform it worked fine. I suppose you must transform current to camera.

  • zigraphixzigraphix Posts: 2,787
    edited December 1969

    gilikshe said:

    Did you try space transform? I had problems with my outline, but with the appropriate transform it worked fine. I suppose you must transform current to camera.

    I haven't tried that yet. Were you also using a Volume root? It does seem likely that the fix will be something like a transform or a way to specify the coordinates somehow.

  • almahiedraalmahiedra Posts: 1,352
    edited December 1969

    zigraphix said:
    gilikshe said:

    Did you try space transform? I had problems with my outline, but with the appropriate transform it worked fine. I suppose you must transform current to camera.

    I haven't tried that yet. Were you also using a Volume root? It does seem likely that the fix will be something like a transform or a way to specify the coordinates somehow.


    No, I don't work with volume, only surface. But in renderman shading lenguage transform is valid for volume blocks.

  • zigraphixzigraphix Posts: 2,787
    edited December 1969

    I can get a surface shader to work even without applying a transform. I can't get the volume shader to show the effect of any of the geometric functions, even with a transform. I suppose the problem is that the "Volume Atmosphere" wants to apply whatever effect I set up to the whole scene, and "Volume Interior" doesn't seem to do anything in a camera.

    It's annoying, because I had some interesting ideas I wanted to try in a camera, but it looks like they can only be done with surfaces. I suppose I could create an "apply to all surfaces" script.... I just didn't want to touch the surface settings at all, so this would be an alternate render method for the same scene.

Sign In or Register to comment.