浏览代码

Merge pull request #2 from Donkeylipsh/em1

Shading Model - Emission Support
/UI
GitHub 4 年前
当前提交
9f80c6a1
共有 5 个文件被更改,包括 305 次插入18 次删除
  1. 134
      UOP1_Project/Assets/Shaders/Toon.shadergraph
  2. 27
      UOP1_Project/Assets/Shaders/CustomHLSL/CustomEmission.hlsl
  3. 9
      UOP1_Project/Assets/Shaders/CustomHLSL/CustomEmission.hlsl.meta
  4. 143
      UOP1_Project/Assets/Shaders/SubGraphs/Emission.shadersubgraph
  5. 10
      UOP1_Project/Assets/Shaders/SubGraphs/Emission.shadersubgraph.meta

134
UOP1_Project/Assets/Shaders/Toon.shadergraph
文件差异内容过多而无法显示
查看文件

27
UOP1_Project/Assets/Shaders/CustomHLSL/CustomEmission.hlsl


#ifndef CUSTOM_EMISSION_INCLUDED
#define CUSTOM_EMISSION_INCLUDED
/***********************************************************
* Emission_float scales an input color, InColor, based on the emission variables:
* bool Emission - Flag that tells shader to apply emission scaling
* float Intensity - The amount the scale InColor. Higher values = more emission
* float3 Mask - Texture mask to control areas of emission on the model. 0. (Black) = No Emission, 1. (White) = full Emission
* float3 InColor - Current value of the material before emission
* And outputs the desired color, OutColor
* float3 OutColor - Output color, masked to apply targeted emission, and scaled for intensity
***********************************************************/
void Emission_float(bool Emission, float Intensity, float3 Mask, float3 InColor, out float3 OutColor)
{
float minEmit = 0.;
float3 emit = Mask * Intensity; // Scale Emission Mask value by the Intensity
if(!Emission || (emit.r <= minEmit && emit.g <= minEmit && emit.b <= minEmit))
{
OutColor = InColor; // Don't do emission
}
else
{
OutColor = 1.5 + emit * InColor; // Do emission (Even black will emit at 1.5)
}
}
#endif

9
UOP1_Project/Assets/Shaders/CustomHLSL/CustomEmission.hlsl.meta


fileFormatVersion: 2
guid: 15cc213f25e6bdd4694946ad9ffc5890
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

143
UOP1_Project/Assets/Shaders/SubGraphs/Emission.shadersubgraph
文件差异内容过多而无法显示
查看文件

10
UOP1_Project/Assets/Shaders/SubGraphs/Emission.shadersubgraph.meta


fileFormatVersion: 2
guid: 9314a166ca2ae0f45928c69c3769b384
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
正在加载...
取消
保存