public void MaterialPaintGroupTest() { MaterialGroup materialGroup = new MaterialGroup(); MaterialPaintGroup layer0 = new MaterialPaintGroup(); MaterialPaintGroup layer1 = new MaterialPaintGroup(); layer0.MaterialParts.Add(new DiffuseMaterialPart()); layer1.MaterialParts.Add(new DiffuseMaterialPart()); materialGroup.MaterialParts.Add(layer0); materialGroup.MaterialParts.Add(layer1); //MaterialGroupBuilder.BuildByUsage(materialGroup, MaterialUsage.Default, new PipelineBuilder().ProcessorContext); }
protected internal override void OnBind() { maskTextureScaleParameter = GetParameter("MaskTextureScale"); maskTexture0Parameter = GetParameter("MaskTexture0"); maskTexture1Parameter = GetParameter("MaskTexture1"); var maskTextures = MaterialPaintGroup.GetMaskTextures(MaterialGroup); maskTexture0 = maskTextures != null && maskTextures.Count > 0 ? maskTextures[0] as Texture2D : null; maskTexture1 = maskTextures != null && maskTextures.Count > 1 ? maskTextures[1] as Texture2D : null; maskTextureScale = MaterialPaintGroup.GetMaskTextureScale(MaterialGroup); maskTextureScale.X = 1.0f / maskTextureScale.X; maskTextureScale.Y = 1.0f / maskTextureScale.Y; }
public void MaterialPaintGroupDeferredLightingUsageTest() { MaterialGroup materialGroup = new MaterialGroup(); MaterialPaintGroup layer0 = new MaterialPaintGroup(); MaterialPaintGroup layer1 = new MaterialPaintGroup(); layer0.MaterialParts.Add(new DiffuseMaterialPart()); layer0.MaterialParts.Add(new SpecularMaterialPart()); layer0.MaterialParts.Add(new NormalMapMaterialPart()); layer1.MaterialParts.Add(new DiffuseMaterialPart()); layer1.MaterialParts.Add(new NormalMapMaterialPart()); materialGroup.MaterialParts.Add(layer0); materialGroup.MaterialParts.Add(layer1); materialGroup.MaterialParts.Add(new DeferredLightsMaterialPart()); //MaterialGroupBuilder.BuildByUsage(materialGroup, MaterialUsage.DepthAndNormal, new PipelineBuilder().ProcessorContext); }
public void MaterialPaintGroupNormalMappingTest() { MaterialGroup materialGroup = new MaterialGroup(); MaterialPaintGroup layer0 = new MaterialPaintGroup(); MaterialPaintGroup layer1 = new MaterialPaintGroup(); layer0.MaterialParts.Add(new DiffuseMaterialPart()); layer0.MaterialParts.Add(new SpecularMaterialPart()); layer0.MaterialParts.Add(new NormalMapMaterialPart()); layer1.MaterialParts.Add(new DiffuseMaterialPart()); layer1.MaterialParts.Add(new NormalMapMaterialPart()); materialGroup.MaterialParts.Add(layer0); materialGroup.MaterialParts.Add(layer1); materialGroup.MaterialParts.Add(new DirectionalLightMaterialPart()); //MaterialGroupBuilder.BuildByUsage(materialGroup, MaterialUsage.Default, new PipelineBuilder().ProcessorContext); }
protected internal override string GetShaderCode(MaterialUsage usage) { var maskCount = MaterialPaintGroup.GetMaskTextures(MaterialGroup).Count; return(GetShaderCode("BeginPaintGroup").Replace("{$T2}", maskCount > 1 ? "" : "//")); }