mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 12:29:23 -05:00
add AlphaModeShowcase
This commit is contained in:
@@ -674,6 +674,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
dependencies: {fileID: 11400000, guid: 21a44348ad7e90744a8e320392d6a0b6, type: 2}
|
||||
alphaModeShowcase: {fileID: 11400000, guid: 9a1685921243e0045902dd01741b2146, type: 2}
|
||||
litShowcase: {fileID: 11400000, guid: eda310b3d75b2634ca76dccda495985e, type: 2}
|
||||
shadeShowcase: {fileID: 11400000, guid: 7f12d1836965ca247be4bbb314f94b23, type: 2}
|
||||
cameraScroller: {fileID: 1644774163}
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace VRM10.Samples.MToon10Showcase
|
||||
public Texture2D checkerTexture;
|
||||
public Texture2D litCheckerTexture;
|
||||
public Texture2D shadeCheckerTexture;
|
||||
public Texture2D alphaModeCheckerTexture;
|
||||
|
||||
public Shader mtoon10Shader;
|
||||
public GameObject labelTextPrefab;
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using VRM10.MToon10;
|
||||
|
||||
namespace VRM10.Samples.MToon10Showcase
|
||||
@@ -10,23 +11,34 @@ namespace VRM10.Samples.MToon10Showcase
|
||||
public class MToon10ShowcaseEntryPoint : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private MToon10ShowcaseDependencies dependencies;
|
||||
|
||||
[FormerlySerializedAs("renderingShowcase")] [SerializeField]
|
||||
private AlphaModeShowcase alphaModeShowcase;
|
||||
|
||||
[SerializeField] private LitShowcase litShowcase;
|
||||
[SerializeField] private ShadeShowcase shadeShowcase;
|
||||
[SerializeField] private CameraScroller cameraScroller;
|
||||
|
||||
private int _currentShowcaseIndex = 0;
|
||||
|
||||
|
||||
private static readonly int Columns = 4;
|
||||
|
||||
private Vector3 _nextOrigin = new(-2.0f, 1.0f, 2.0f);
|
||||
|
||||
private static readonly float SphereRadius = 0.3f;
|
||||
private static readonly float SphereSpacing = 0.2f;
|
||||
private static readonly float LabelSpacing = 0.1f;
|
||||
|
||||
private Vector3 _nextOrigin = new(-2.0f, 1.0f, 2.0f);
|
||||
|
||||
private void Start()
|
||||
{
|
||||
CreateShowcase(alphaModeShowcase.entries, alphaModeShowcase.baseMaterial, (entry, context) =>
|
||||
{
|
||||
context.BaseColorTexture = dependencies.alphaModeCheckerTexture;
|
||||
context.BaseColorFactorSrgb = Color.white;
|
||||
context.ShadeColorTexture = dependencies.alphaModeCheckerTexture;
|
||||
context.ShadeColorFactorSrgb = Color.white;
|
||||
context.AlphaMode = entry.alphaMode;
|
||||
context.TransparentWithZWriteMode = entry.transparentWithZWriteMode;
|
||||
context.AlphaCutoff = entry.alphaCutoff;
|
||||
context.DoubleSidedMode = entry.doubleSidedMode;
|
||||
});
|
||||
CreateShowcase(litShowcase.entries, litShowcase.baseMaterial, (entry, context) =>
|
||||
{
|
||||
context.BaseColorFactorSrgb = entry.litColor;
|
||||
@@ -59,6 +71,7 @@ namespace VRM10.Samples.MToon10Showcase
|
||||
{
|
||||
var obj = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
obj.transform.SetParent(root.transform);
|
||||
obj.transform.rotation = Quaternion.Euler(90.0f, 0.0f, 0.0f);
|
||||
var x = idx % columnCount * gridSpacing + gridOrigin.x;
|
||||
var z = -idx / columnCount * gridSpacing + gridOrigin.z;
|
||||
obj.transform.localPosition = new Vector3(x, 0.0f, z);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using VRM10.MToon10;
|
||||
|
||||
namespace VRM10.Samples.MToon10Showcase
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
[CreateAssetMenu(menuName = "VRM10/Samples/MToon10Showcase/" + nameof(AlphaModeShowcase))]
|
||||
#endif
|
||||
public sealed class AlphaModeShowcase : ScriptableObject
|
||||
{
|
||||
public Material baseMaterial;
|
||||
public AlphaModeEntry[] entries;
|
||||
|
||||
[Serializable]
|
||||
public sealed class AlphaModeEntry
|
||||
{
|
||||
public MToon10AlphaMode alphaMode;
|
||||
public MToon10TransparentWithZWriteMode transparentWithZWriteMode;
|
||||
public float alphaCutoff;
|
||||
public MToon10DoubleSidedMode doubleSidedMode;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8218ff2a8efb4e0180079c635a898336
|
||||
timeCreated: 1743147086
|
||||
@@ -0,0 +1,56 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
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: 8218ff2a8efb4e0180079c635a898336, type: 3}
|
||||
m_Name: Alpha Mode Template
|
||||
m_EditorClassIdentifier:
|
||||
baseMaterial: {fileID: 2100000, guid: 81f544d870b76884382d3365eff048b2, type: 2}
|
||||
entries:
|
||||
- alphaMode: 0
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 0
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 1
|
||||
- alphaMode: 1
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 1
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0.25
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 1
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0.5
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 1
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0.75
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 2
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 2
|
||||
transparentWithZWriteMode: 1
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 0
|
||||
- alphaMode: 2
|
||||
transparentWithZWriteMode: 0
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 1
|
||||
- alphaMode: 2
|
||||
transparentWithZWriteMode: 1
|
||||
alphaCutoff: 0
|
||||
doubleSidedMode: 1
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a1685921243e0045902dd01741b2146
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -15,6 +15,8 @@ MonoBehaviour:
|
||||
checkerTexture: {fileID: 2800000, guid: 517d4a74c74ce8643bff9f69fa581a20, type: 3}
|
||||
litCheckerTexture: {fileID: 2800000, guid: 1de801c8b8e0d6544b5ebb56ea8bfe60, type: 3}
|
||||
shadeCheckerTexture: {fileID: 2800000, guid: 8d6a11ae5e99a5b47b59746810a26b46, type: 3}
|
||||
alphaModeCheckerTexture: {fileID: 2800000, guid: 770eec6de1e32c042b64072fb4369f8a,
|
||||
type: 3}
|
||||
mtoon10Shader: {fileID: 4800000, guid: 0781c64b7f2a1604ea6aa7e252080372, type: 3}
|
||||
labelTextPrefab: {fileID: 5685776853168224818, guid: 682e9acde1b2bd6408deebec0fa47919,
|
||||
type: 3}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 723 KiB |
@@ -0,0 +1,114 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 770eec6de1e32c042b64072fb4369f8a
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 0
|
||||
wrapV: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user