Skip to content

Materials in UE4

What is a material?

Collection of image files and shaders

Define wood =surface looks like made of wood

like Paint

how light interact with that surface

But can Glow/Transparent

Magical Paint

In UE3

  • Diffuse
  • Specular(某点的亮光)
  • SpecPower

In UE4

  • Base Color
    • surface的基础色
  • Metallic
    • 有多金属化
    • 0 or 1
    • 没有between的-0-?
  • Roughness
    • 表面多粗糙
      • Ball made of glass
        • reflection  of sun
        • reflection of you
          • because it is really smooth
      • Ball made of chalk
        • no reflection
    • between 0.1~0.9
  • Emissive (glow)
  • Normals (bumps)
  • & many more

Floating Point Color

Pixel(RGB A) 【0~1】

Yellow( 1,1,0,1 )

[像Emissive的话,如果用R 10 G 10那么就会很亮的yellow]

Make a Basic Material

  • Material Folder
  • Palette
    • 不常用
    • 右键就可以获取
    • 可以看快捷键
      • 1 constant
      • m multiply
  • 没修改的会有一个default material 格格状
    • 或者出错
  • 颜色
    • Constant 3Vector
    • 不一定非得存颜色
  • Metallic
    • Constant
      • 按住1 点一下
    • 1 ->Metallic
    • 0-> plastic
    • 0.5 不是很realistic
  • Specular
    • 一个艺术家的技巧
  • Roughness
    • Constant
    • 1->Chalk
    • 0.8->Specular Highlight
    • 0->reflect
      • 0.1比较真实
    • 0.05 perfect mirror
    • Mirror
      • white
      • Metallic 1
      • Roughness 0.05
    • 实例
      • Plastic
        • 0.7 Roughness
        • 0 Metallic
    • Specular
      • 只能是Non-Metallic
      • Constant default = 0.5
      • Specular(非金属的反射)
        • 1 云彩的Reflection非常清楚
        • 0 无Reflection
    • 点Apply

Add Textures

  • Diffuse
  • Normal Map
    • 凹凸阴影
  • 按住L可以改变光照
  • Textures Folder
    • Wood
  • 不用Color了
  • 然后把Texture拉进来,连接到BaseColor
  • Wood
    •  Texture of base color
    • Metallic =》 0
    • Roughness
      • 用wood 的texture 的alphaChannel,不同的地方Roughness不一样
      • Alpha -> Lerp(A代表黑色,B代表白色,可以在DetailPanel 改,Wood的A0.8~B0.3)->Roughness
    • Normal Map
      • rotate pixel around 
      • Texture 凹凸
    • Texture Tiling
      • UV input
        • texture coordinate
        • Texture Coordinate Node
          • 修改VTiling和UTiling
            • 3

Masks

  • T_Ceramic_Tile_M 合在一起变成彩色的图(以及他的Normal Map)
    • Mask tile condense into one image
    • Red 线条 gaps
    • Green 黑白
    • Blue 黑白
    • Alpha 白色
  • Wood继续(在任何一个Node都可以右键Preview)
    • 从Base Texture->Multiply(B)
    • 然后从CeramicTile的Red Channel到Multiply(A)-》Base Color
    • Normal Map
      • Red & Green give you the Sense of Depth
      • Blue the actual surface itself
    • T_Ceramic_Tile_N->RGB Output->Mask(RG)=Append(R,G)->这个时候需要再重新加上Blue,才能和其他的NormalMap联合在一起Append(0Node)样子没变,但是格式变得compatible了   ===》Add(B,A=Wood的Normal Map)=》Normal这样就可以把那个间隔的凹凸感体现出来
  • 现在继续用NormalMap的Green和Blue的Channel
    • Make a lerp between original color to any value
    • 3Vector(Red 0.79,0.1,0.06)
    • Wood Texture -> Red Wood
    • Lerp
      • WoodTexture->ColorBlack A 
      • Red-> Color White B
      • Ceramic Green Channel -> Alpha 
        • Output of Lerp
    • Multiply with(Texture)
      • ->Base Color
    • Red ->Multiply A
    • Wood Texture Red Channel ->Lerp(B)
  • 现在用Blue
    • Lerp 上面那个Lerp
    • 也是和wood的Red Channel multiply 那个blue
    • 上一个Lerp的结果-》A
    • 然后Blue-》B
    • 最后将Lerp-》Multiply的B

Analyze

Mask的概念:不同的Channel,来的时候,就是Multiply

然后Lerp的概念,就是一种组装Mask的感觉

第一个lerp是把木板的纹理lerp起来(同时用Mask的GreenChannel),第二个lerp是把木板纹理和偏蓝的木板纹理lerp起来(同时使用Mask的BlueChannel),然后最后Multiply到BaseColor

Multiply的概念是叠加起来,最后一个multiply是把gap和组合好的木板纹理,重新配色之后的木板纹理重叠起来

重新配色:Multiply和Lerp的AB Channel

重新组合Mask:Lerp的Alpha Channel

纹理和颜色的组合:Multiply(无论是纯色还是Lerp的结果)

Lerp的Alpha更像是位置的指示

 

Roughness单独从0~1的Alpha的组合

 

Invert Emissive Color

从Red Channel 接入 1-x(invert)【用来得到gap】,然后接入Cheap Contrast(相当于一个过滤器,保留Gap,但是其他部分的阴影去掉)

结果Multiply -》和橙色相乘【赋予gap颜色】,然后接入Emissive Color!!!!!!

在接入Emissive Color之前,要Multiply 10!!!!!!!!!【让颜色更Emissive】

Material Instance

  • Useful!!!!!
  • Single Parent Material:Basic Metal
  • Instance 用Single Parent Material
    • Variations called child
      • Child
        • Copper
      • Child
        • Aluminium
    • Parameters
      • 可以修改的参数
  • 用参数而不是用Constant value
    • 3Vector
    • Compile
      • Children不会Compile
      • 只有Parent会
  • Vector Parameter Node
    • Default value
    • Name: BaseColorTint
  • Texture Sample Parameter Node
    • Name: Base Color Texture
      • multiply
  • Scalar Parameter Node
    • Name: Custom MetallicVal
    • Name:Custom  RoughnessVal
  • Material Instance Editor
    • Change Parameters
    • 对于设计师更方便

Dynamic Material Instance

  • 可以在运行的时候修改
  • 需要
    • Parameterized Material
    • Blueprint
  • Chair
    • ColorSeats
  • Blueprint Derived from static Mesh
    • Random Chair
    • Box
    • Chair
  • Blueprint
    • Construction Script
      •  Chair
        • CreateDynamic Material Instance
          • 自动创建一个Instance
        • promote into valuable
    • EventGraph
      • Box
        • OnComponentBeginOverlap
      • DynamicMaterial
        • Set  Vector Parameter
          • Random Value
          • Make Color

Play快捷键: Alt+P

Published inDiaryUnrealEngine

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

http://next.sh/wp-content/smilies/icon_confused.gif 
http://next.sh/wp-content/smilies/icon_cool.gif 
http://next.sh/wp-content/smilies/icon_cry.gif 
http://next.sh/wp-content/smilies/icon_eek.gif 
http://next.sh/wp-content/smilies/icon_evil.gif 
http://next.sh/wp-content/smilies/icon_exclaim.gif 
http://next.sh/wp-content/smilies/icon_idea.gif 
http://next.sh/wp-content/smilies/icon_mad.gif 
http://next.sh/wp-content/smilies/icon_mrgreen.gif 
http://next.sh/wp-content/smilies/icon_neutral.gif 
http://next.sh/wp-content/smilies/icon_question.gif 
http://next.sh/wp-content/smilies/icon_razz.gif 
http://next.sh/wp-content/smilies/icon_redface.gif 
http://next.sh/wp-content/smilies/icon_rolleyes.gif 
http://next.sh/wp-content/smilies/icon_sad.gif 
http://next.sh/wp-content/smilies/icon_smile.gif 
http://next.sh/wp-content/smilies/icon_arrow.gif 
http://next.sh/wp-content/smilies/icon_biggrin.gif 
http://next.sh/wp-content/smilies/icon_surprised.gif 
http://next.sh/wp-content/smilies/icon_twisted.gif 
http://next.sh/wp-content/smilies/10.gif 
http://next.sh/wp-content/smilies/102.gif 
http://next.sh/wp-content/smilies/103.gif 
http://next.sh/wp-content/smilies/106.gif 
http://next.sh/wp-content/smilies/108.gif 
http://next.sh/wp-content/smilies/20.gif 
http://next.sh/wp-content/smilies/26.gif 
http://next.sh/wp-content/smilies/37.gif 
http://next.sh/wp-content/smilies/99.gif