public void Build(BRDF_TYPE _BRDFType) { Debug.Assert(m_refCounting >= 0); if (m_refCounting == 0) { var hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset; switch (_BRDFType) { case BRDF_TYPE.GGX_SMITH_SCHLICK: m_PreIntegratedFGDMaterial = CoreUtils.CreateEngineMaterial(hdrp.renderPipelineResources.preIntegratedFGD); break; case BRDF_TYPE.WARD_MORODER_SCHLICK: m_PreIntegratedFGDMaterial = CoreUtils.CreateEngineMaterial(hdrp.renderPipelineResources.preIntegratedFGD_AxFWard); break; } m_PreIntegratedFGD = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGB2101010, RenderTextureReadWrite.Linear); m_PreIntegratedFGD.hideFlags = HideFlags.HideAndDontSave; m_PreIntegratedFGD.filterMode = FilterMode.Bilinear; m_PreIntegratedFGD.wrapMode = TextureWrapMode.Clamp; m_PreIntegratedFGD.hideFlags = HideFlags.DontSave; m_PreIntegratedFGD.name = CoreUtils.GetRenderTargetAutoName(128, 128, 1, RenderTextureFormat.ARGB2101010, "PreIntegratedFGD"); m_PreIntegratedFGD.Create(); m_isInit = false; } m_refCounting++; }
protected override void MaterialPropertiesGUI(Material _material) { EditorGUILayout.LabelField(Styles.InputsText, EditorStyles.boldLabel); BRDF_TYPE BRDFType = (BRDF_TYPE)m_BRDFType.floatValue; BRDFType = (BRDF_TYPE)EditorGUILayout.Popup("BRDF Type", (int)BRDFType, BRDFTypeNames); m_BRDFType.floatValue = (float)BRDFType; switch (BRDFType) { case BRDF_TYPE.SVBRDF: { EditorGUILayout.Space(); ++EditorGUI.indentLevel; EditorGUILayout.LabelField("CAILLOU!", EditorStyles.boldLabel); m_MaterialEditor.TexturePropertySingleLine(Styles.diffuseColorText, m_diffuseColorMap); m_MaterialEditor.TexturePropertySingleLine(Styles.specularColorText, m_specularColorMap); m_MaterialEditor.TexturePropertySingleLine(Styles.specularLobeText, m_specularLobeMap); m_MaterialEditor.TexturePropertySingleLine(Styles.fresnelText, m_fresnelMap); m_MaterialEditor.TexturePropertySingleLine(Styles.normalText, m_normalMap); --EditorGUI.indentLevel; break; } } // m_MaterialEditor.TexturePropertySingleLine( Styles.baseColorText, m_baseColorMap, m_baseColor ); // m_MaterialEditor.TextureScaleOffsetProperty( m_baseColorMap ); // m_MaterialEditor.TexturePropertySingleLine(Styles.emissiveText, emissiveColorMap, emissiveColor); // m_MaterialEditor.TextureScaleOffsetProperty(emissiveColorMap); // m_MaterialEditor.ShaderProperty(emissiveIntensity, Styles.emissiveIntensityText); // m_MaterialEditor.ShaderProperty(albedoAffectEmissive, Styles.albedoAffectEmissiveText); var surfaceTypeValue = (SurfaceType)surfaceType.floatValue; if (surfaceTypeValue == SurfaceType.Transparent) { EditorGUILayout.Space(); EditorGUILayout.LabelField(StylesBaseUnlit.TransparencyInputsText, EditorStyles.boldLabel); ++EditorGUI.indentLevel; DoDistortionInputsGUI(); --EditorGUI.indentLevel; } }