zoukankan      html  css  js  c++  java
  • 使用RampTexture来控制diffuse shading

    RampTexture

      RampTexture(渐变纹理),可以是1D/2D纹理.

      This allows you to accentuate the surface's colors to fake the effects of more bounce light or a more advanced lighting setup. You see this technique used a lot more for cartoony games, where you need a more artist-driven look to your Shaders and not so much of a physically-accurate lighting model. 

      首先需要一张渐变纹理:

      

      在Half Lambert的基础上,使用RampTexture来控制diffuse shading:

      

      The following is the result you will see after running the code: 

      

    How it works

      We take the re-mapped diffuse values from the Half Lambert operation and pass them into float2() to create the lookup values for the texture. When a value of 0 is set as the hLambert variable, the tex2D function looks up the pixel value at the UV value of (0,0). In this case it's the subtle peach color from the ramps gradient. When a value of 1 is set for the hLambert variable, the tex2D function looks up the pixel at the UV value of (1,1), or the white color. 

      

  • 相关阅读:
    Jzoj2682 最长双回文串
    Jzoj2682 最长双回文串
    【hdu3853】Loops
    【tyvj1015】【caioj1060】公路乘车
    【luogu1064】金明的预算方案
    【bzoj1260】【CQOI2007】涂色paint
    【UVa1629】Cake slicing
    【NYOJ746】整数划分(四)
    【NYOJ 15】括号匹配2
    【poj2955】Brackets
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3978942.html
Copyright © 2011-2022 走看看