URP向けのシェーダーをとりあえず追加

This commit is contained in:
notargs
2023-04-25 09:26:11 +09:00
parent 7c2d360774
commit 0f3bdf3b2b
5 changed files with 339 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 282c8c12552fd4c42840a5dda6ae2c9b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,175 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-9194869756555787169
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 4
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: URPMToon10
m_Shader: {fileID: 4800000, guid: 0781c64b7f2a1604ea6aa7e252080372, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MatcapTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineWidthTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _RimTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadeTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ShadingShiftTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _UvAnimMaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 0
- _AlphaMode: 0
- _Blend: 0
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DoubleSided: 0
- _DstBlend: 0
- _EnvironmentReflections: 1
- _GiEqualization: 0.9
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _M_AlphaToMask: 0
- _M_CullMode: 2
- _M_DebugMode: 0
- _M_DstBlend: 0
- _M_EditMode: 0
- _M_SrcBlend: 1
- _M_ZWrite: 1
- _Metallic: 0
- _OcclusionStrength: 1
- _OutlineLightingMix: 1
- _OutlineWidth: 0
- _OutlineWidthMode: 0
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _RenderQueueOffset: 0
- _RimFresnelPower: 5
- _RimLift: 0
- _RimLightingMix: 1
- _ShadingShiftFactor: -0.05
- _ShadingShiftTexScale: 1
- _ShadingToonyFactor: 0.95
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Surface: 0
- _TransparentWithZWrite: 0
- _UvAnimRotationSpeed: 0
- _UvAnimScrollXSpeed: 0
- _UvAnimScrollYSpeed: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _MatcapColor: {r: 0, g: 0, b: 0, a: 1}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _RimColor: {r: 0, g: 0, b: 0, a: 1}
- _ShadeColor: {r: 1, g: 1, b: 1, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3b3d2f142a7a89b42a3d483dacb0a2af
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,139 @@
Shader "VRM10/MToon10_URP"
{
Properties
{
// Rendering
_AlphaMode ("alphaMode", Int) = 0
_TransparentWithZWrite ("mtoon.transparentWithZWrite", Int) = 0
_Cutoff ("alphaCutoff", Range(0, 1)) = 0.5 // Unity specified name
_RenderQueueOffset ("mtoon.renderQueueOffsetNumber", Int) = 0
_DoubleSided ("doubleSided", Int) = 0
// Lighting
_Color ("pbrMetallicRoughness.baseColorFactor", Color) = (1, 1, 1, 1) // Unity specified name
_MainTex ("pbrMetallicRoughness.baseColorTexture", 2D) = "white" {} // Unity specified name
_ShadeColor ("mtoon.shadeColorFactor", Color) = (1, 1, 1, 1)
_ShadeTex ("mtoon.shadeMultiplyTexture", 2D) = "white" {}
[Normal] _BumpMap ("normalTexture", 2D) = "bump" {} // Unity specified name
_BumpScale ("normalTexture.scale", Float) = 1.0 // Unity specified name
_ShadingShiftFactor ("mtoon.shadingShiftFactor", Range(-1, 1)) = -0.05
_ShadingShiftTex ("mtoon.shadingShiftTexture", 2D) = "black" {} // channel R
_ShadingShiftTexScale ("mtoon.shadingShiftTexture.scale", Float) = 1
_ShadingToonyFactor ("mtoon.shadingToonyFactor", Range(0, 1)) = 0.95
// GI
_GiEqualization ("mtoon.giEqualizationFactor", Range(0, 1)) = 0.9
// Emission
[HDR] _EmissionColor ("emissiveFactor", Color) = (0, 0, 0, 1) // Unity specified name
_EmissionMap ("emissiveTexture", 2D) = "white" {} // Unity specified name
// Rim Lighting
_MatcapColor ("mtoon.matcapFactor", Color) = (0, 0, 0, 1)
_MatcapTex ("mtoon.matcapTexture", 2D) = "black" {}
_RimColor ("mtoon.parametricRimColorFactor", Color) = (0, 0, 0, 1)
_RimFresnelPower ("mtoon.parametricRimFresnelPowerFactor", Range(0, 100)) = 5.0
_RimLift ("mtoon.parametricRimLiftFactor", Range(0, 1)) = 0
_RimTex ("mtoon.rimMultiplyTexture", 2D) = "white" {}
_RimLightingMix ("mtoon.rimLightingMixFactor", Range(0, 1)) = 1
// Outline
_OutlineWidthMode ("mtoon.outlineWidthMode", Int) = 0
[PowerSlider(2.2)] _OutlineWidth ("mtoon.outlineWidthFactor", Range(0, 0.05)) = 0
_OutlineWidthTex ("mtoon.outlineWidthMultiplyTexture", 2D) = "white" {} // channel G
_OutlineColor ("mtoon.outlineColorFactor", Color) = (0, 0, 0, 1)
_OutlineLightingMix ("mtoon.outlineLightingMixFactor", Range(0, 1)) = 1
// UV Animation
_UvAnimMaskTex ("mtoon.uvAnimationMaskTexture", 2D) = "white" {} // channel B
_UvAnimScrollXSpeed ("mtoon.uvAnimationScrollXSpeedFactor", Float) = 0
_UvAnimScrollYSpeed ("mtoon.uvAnimationScrollYSpeedFactor", Float) = 0
_UvAnimRotationSpeed ("mtoon.uvAnimationRotationSpeedFactor", Float) = 0
// Unity ShaderPass Mode
_M_CullMode ("_CullMode", Float) = 2.0
_M_SrcBlend ("_SrcBlend", Float) = 1.0
_M_DstBlend ("_DstBlend", Float) = 0.0
_M_ZWrite ("_ZWrite", Float) = 1.0
_M_AlphaToMask ("_AlphaToMask", Float) = 0.0
// etc
_M_DebugMode ("_DebugMode", Float) = 0.0
// for Editor
_M_EditMode ("_EditMode", Float) = 0.0
}
// Shader Model 3.0
SubShader
{
Tags { "RenderType" = "Opaque" "Queue" = "Geometry" }
// Built-in Forward Base Pass
Pass
{
Name "FORWARD_BASE"
Tags { "LightMode" = "ForwardBase" }
Cull [_M_CullMode]
Blend [_M_SrcBlend] [_M_DstBlend]
ZWrite [_M_ZWrite]
ZTest LEqual
BlendOp Add, Max
AlphaToMask [_M_AlphaToMask]
HLSLPROGRAM
#pragma target 3.0
// Unity defined keywords
#pragma multi_compile_fwdbase nolightmap nodynlightmap nodirlightmap novertexlight
#pragma multi_compile_fog
#pragma multi_compile_instancing
#pragma multi_compile __ _ALPHATEST_ON _ALPHABLEND_ON
#pragma multi_compile __ _NORMALMAP
#pragma multi_compile __ _MTOON_EMISSIVEMAP
#pragma multi_compile __ _MTOON_RIMMAP
#pragma multi_compile __ _MTOON_PARAMETERMAP
#pragma vertex MToonVertex
#pragma fragment MToonFragment
#include "./vrmc_materials_mtoon_forward_vertex.hlsl"
#include "./vrmc_materials_mtoon_forward_fragment.hlsl"
ENDHLSL
}
// Shadow rendering pass
Pass
{
Name "ShadowCaster"
Tags { "LightMode" = "ShadowCaster" }
Cull [_M_CullMode]
ZWrite On
ZTest LEqual
CGPROGRAM
#pragma target 3.0
// Unity defined keywords
#pragma multi_compile_shadowcaster nolightmap nodynlightmap nodirlightmap novertexlight
#pragma multi_compile_instancing
#pragma multi_compile __ _ALPHATEST_ON _ALPHABLEND_ON
// Use unity standard shadow implementation.
// internal usage:
// keywords: _ALPHATEST_ON _ALPHABLEND_ON
// variables: _MainTex.a _Color.a _Cutoff
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#include "UnityStandardShadow.cginc"
ENDCG
}
}
Fallback "Unlit/Texture"
CustomEditor "VRMShaders.VRM10.MToon10.Editor.MToonInspector"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0781c64b7f2a1604ea6aa7e252080372
timeCreated: 1514111466
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant: