Announcement

Collapse
No announcement yet.

Black Splotches on Materials

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

    Black Splotches on Materials

    I followed the tutorial here:
    http://udn.epicgames.com/Three/Terra...dTextures.html

    Im am trying to create a terrain material, a base texture mixed with a detail texture (128x128 greyscale) per the tutorial.
    (from the tutorial)

    The selected expressions provide the Detail texture set in this Material:

    •Texture Sample = the Detail texture.
    •TexCoord = the tiling amount of the Detail texture with respect to the main diffuse rock texture, adjust as desired.
    •ScalarParameter "Detail Brightness" = the brightness mix value for the Detail, this supports Material Instancing. This expression can be replaced with a Constant if no Instancing is going to be used.
    •Multiply = the Detail Adjust multiplier used to adjust the overall brightness of the Detail in the material mix.
    The ScalarParameter and Multiply expressions are adjusted so that the Material is the same brightness with the Detail as it is without. The second Multiply expression (Diffuse * Detail) mixes the Rock diffuse texture with the Detail texture.


    My version with the splotchy black areas


    Why am I getting the black areas on the material? The texture's were imported BMP's and look fine.

    #2
    Looks like maybe the dark bits on your detail texture are just a bit dark (so no matter how much you multiply it with the brightness param, they're gona stay black). Just try adjusting your texture in photoshop to exclude the lower values?

    Comment


      #3
      Yes. 0*X=X. So, no matter what you multiply by, the black will always be black.
      However, if you're looking for a detail texture, then your TexCoord needs to be set way higher than it is. Try setting the U & V in your TexCoord to about 15 or so. The idea is to have very fine details that you'll only notice up close. So, even if there are small black spots, they won't be very noticeable. Although, it would work better if you clamped the minimum value of your detail texture to 0.1 or so. That way, you'd have no black.

      You can do that by connecting your detail texture to a ConstantClamp and connecting the constant clamp to the multiply. You can adjust the min/max values of color in the constant clamp. I'd try min of 0.1 or 0.05 and a max of 1.0.

      Comment


        #4
        Originally posted by Wyldhunt
        Yes. 0*X=X.
        You mean 0*X=0?

        Comment


          #5
          ...!
          How dare you question my skilz?!

          And, yes. What Spoondog said...

          Comment


            #6
            Since its a greyscale image, what about plugging in the red, green or blue channel? Shouldn't that fix the problem?

            Comment


              #7
              That wouldn't help.

              The way the mat editor works is thus:

              Each pixel of the RGB has 3 different color channels (RGB).
              For the example, lets say that the pixel we're looking at is 0.3, 0.5, 1.0

              Each pixel of the Grayscale image has 3 identical color channels.
              For the example, lets say that it's perfect gray (0.5, 0.5, 0.5).

              Light gray might look like 0.1, 0.1, 0.1 while a dark gray might be 0.9, 0.9, 0.9. But all 3 values will always be the same so that the color will be a shade of gray.

              Float3 RGB X Float3 Grayscale(What he has now) would multiply the first channel RGB with the first channel grayscale (0.3*0.5=0.15), multiply second channel RGB with second channel gray (0.5*0.5=0.25), and then multiply both 3rd channels(1.0*0.5=0.5). That would give that pixel an RGB color of 0.15, 0.25, 0.5.

              If you connect a single output of the grayscale image to a RGB, you get a Float1 X Float3. It will multiply all 3 channels of the RGB by that single Float1 value. In this case, we know that the value will be 0.5 no matter which single channel they choose, because they are all the same (Gray).

              So, once they connect one of the Grayscale floats to the RGB, they will get the exact same result. IE 0.15, 0.25, 0.5.

              The only real issue with the material setup itself is that it should be clamped before being attached to the Diffuse input to avoid blooming from the multiply param. But, that's a different issue.

              Comment


                #8
                Thanks for the tips, especially yours Wyldhunt. The constant clamp worked perfect.

                Comment


                  #9
                  Either use LERP node instead of multiply for greyscale, or insert ADD node and add 0.1 or so value. And yes you multiply by 0 or close to it.

                  Comment


                    #10
                    It's a greyscale detail texture. Lerping would defeat the purpose. If they used an add node to add 0.1, then any white would be 1.1 and would potentially add color bloom. Then, they'd still need the clamp before they connected it to their diffuse to maintain a 1.0 max.

                    The only decent ways to fix that are either Photoshop or a constant clamp with a non-0 minimum.

                    Comment

                    Working...
                    X