Announcement

Collapse
No announcement yet.

Expression Map

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Expression Map

    I really would love a map like this:

    InputMap1: [Gradient Ramp]
    InputMap2: [Noise]

    Red = (InputMap2.r-(1-InputMap1.r))*(1000)
    Green = (InputMap2.g-(1-InputMap1.g))*(1000)
    Blue = (InputMap2.b-(1-InputMap1.b))*(1000)

    It would make for simplification of some pretty obnoxiously complex tex composite nodes.
    Gavin Greenwalt
    im.thatoneguy[at]gmail.com || Gavin[at]SFStudios.com
    Straightface Studios

  • #2
    You can always create a GLSL or an OSL shader for this.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      My understanding of the GLSL interface is that you can't address max procedural maps, is that wrong? Can you sample max maps through OSL or GLSL?
      Last edited by im.thatoneguy; 25-02-2016, 01:35 AM.
      Gavin Greenwalt
      im.thatoneguy[at]gmail.com || Gavin[at]SFStudios.com
      Straightface Studios

      Comment


      • #4
        Originally posted by im.thatoneguy View Post
        My understanding of the GLSL interface is that you can't address max procedural maps, is that wrong? Can you sample max maps through OSL or GLSL?
        Of course you can... it would have been pretty limiting to support only bitmaps.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          Marvelous! The best kind of wishlist. The instant gratification wish.

          Code:
          uniform sampler2D noiseMap;
          uniform sampler2D gradientMap;
          uniform float hardness;
          
          void main() {
          vec2 uv_coords = vec2(gl_TexCoord[0]);
          vec3 nSample = vec3(texture2D(noiseMap, uv_coords));
          vec3 gSample = vec3(texture2D(gradientMap, uv_coords));
          vec3 hardMix = ((nSample-(vec3(1.0)-gSample))*(pow(2.0,hardness)));
          hardMix = max(hardMix, vec3(0.0));
          hardMix = min(hardMix, vec3(1.0));
          
          gl_FragColor = vec4(hardMix,1.0);
          
          }
          Radial gradients in screen space as "noise" map and "Falloff: shadow/highlight" as the "Gradient" map.

          Click image for larger version

Name:	Halftone.jpg
Views:	1
Size:	158.5 KB
ID:	859935
          Gavin Greenwalt
          im.thatoneguy[at]gmail.com || Gavin[at]SFStudios.com
          Straightface Studios

          Comment


          • #6
            Supercool Glad it worked out!

            Best regards,
            Vlado
            I only act like I know everything, Rogers.

            Comment

            Working...
            X