Add material icons for transparent and translucent things.

This commit is contained in:
KillzXGaming 2019-05-30 21:42:23 -04:00
parent 2299a61cb3
commit 31b2ab8260
15 changed files with 67 additions and 3 deletions

Binary file not shown.

View file

@ -335,7 +335,6 @@ namespace FirstPlugin
shader = OpenTKSharedResources.shaders["BFRES_Normals"]; shader = OpenTKSharedResources.shaders["BFRES_Normals"];
shader.UseProgram(); shader.UseProgram();
shader.SetMatrix4x4("camMtx", ref camMat); shader.SetMatrix4x4("camMtx", ref camMat);
shader.SetMatrix4x4("mtxProj", ref projMat); shader.SetMatrix4x4("mtxProj", ref projMat);
shader.SetMatrix4x4("mtxCam", ref computedCamMtx); shader.SetMatrix4x4("mtxCam", ref computedCamMtx);
@ -845,15 +844,45 @@ namespace FirstPlugin
private static void SetRenderPass(FMAT mat, SF.Shader shader, FSHP m, int id) private static void SetRenderPass(FMAT mat, SF.Shader shader, FSHP m, int id)
{ {
bool IsTranslucent = false;
bool IsTransparentMask = false;
if (mat.shaderassign.ShaderArchive == "Turbo_UBER") if (mat.shaderassign.ShaderArchive == "Turbo_UBER")
{ {
AglShaderTurbo aglShader = new AglShaderTurbo(); AglShaderTurbo aglShader = new AglShaderTurbo();
for (int i = 0; i < mat.renderinfo.Count; i++) for (int i = 0; i < mat.renderinfo.Count; i++)
{
if (mat.renderinfo[i].Name == "gsys_render_state_mode")
{
IsTranslucent = mat.renderinfo[i].ValueString.Contains("translucent");
IsTransparentMask = mat.renderinfo[i].ValueString.Contains("mask");
}
aglShader.LoadRenderInfo(mat.renderinfo[i]); aglShader.LoadRenderInfo(mat.renderinfo[i]);
}
// aglShader.LoadRenderPass(mat, shader); // aglShader.LoadRenderPass(mat, shader);
} }
else
{
if (mat.shaderassign.options.ContainsKey("enable_translucent"))
IsTranslucent = mat.shaderassign.options["enable_translucent"] == "1";
if (mat.shaderassign.options.ContainsKey("enable_translucent"))
IsTransparentMask = mat.shaderassign.options["enable_transparent"] == "1";
}
SetMaterialIcon(mat, IsTranslucent, "MaterialTranslucent");
SetMaterialIcon(mat, IsTransparentMask, "MaterialTransparent");
}
private static void SetMaterialIcon(FMAT mat, bool IsEffect, string Key)
{
if (IsEffect)
{
mat.ImageKey = Key;
mat.SelectedImageKey = Key;
}
} }
private static void SetUniforms(FMAT mat, SF.Shader shader, FSHP m, int id) private static void SetUniforms(FMAT mat, SF.Shader shader, FSHP m, int id)

View file

@ -109,6 +109,9 @@ namespace Switch_Toolbox.Library
imgList.Images.Add("folder", Properties.Resources.skeleton); imgList.Images.Add("folder", Properties.Resources.skeleton);
imgList.Images.Add("TextureMaterialMap", Properties.Resources.TextureMaterialMap); imgList.Images.Add("TextureMaterialMap", Properties.Resources.TextureMaterialMap);
imgList.Images.Add("MaterialTranslucent", Properties.Resources.materialSphereTranslucent);
imgList.Images.Add("MaterialTransparent", Properties.Resources.materialSphereTransparent);
//Data types //Data types
imgList.Images.Add("bool", Properties.Resources.IconBool); imgList.Images.Add("bool", Properties.Resources.IconBool);
imgList.Images.Add("buffer", Properties.Resources.IconBuffer); imgList.Images.Add("buffer", Properties.Resources.IconBuffer);

View file

@ -510,6 +510,26 @@ namespace Switch_Toolbox.Library.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap materialSphereTranslucent {
get {
object obj = ResourceManager.GetObject("materialSphereTranslucent", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap materialSphereTransparent {
get {
object obj = ResourceManager.GetObject("materialSphereTransparent", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View file

@ -367,4 +367,10 @@
<data name="UVPattern1" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="UVPattern1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UVPattern.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\UVPattern.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="materialSphereTranslucent" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\materialSphereTranslucent.tif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="materialSphereTransparent" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\materialSphereTransparent.tif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -1083,6 +1083,12 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\AlphaIconDisabled.png" /> <None Include="Resources\AlphaIconDisabled.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\materialSphereTranslucent.tif" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\materialSphereTransparent.tif" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>