#MERGE 21eaa49 & 777c2f62
This commit is contained in:
commit
cf22c67e6f
11 changed files with 165 additions and 32 deletions
|
|
@ -14,6 +14,8 @@ namespace SM.Base.Shaders
|
|||
/// </summary>
|
||||
public abstract class MaterialShader : GenericShader
|
||||
{
|
||||
static bool _canLineWidth = true;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected MaterialShader(string combinedData) : base(combinedData)
|
||||
{
|
||||
|
|
@ -39,10 +41,20 @@ namespace SM.Base.Shaders
|
|||
|
||||
context.Mesh.Activate();
|
||||
|
||||
if (context.Mesh is ILineMesh lineMesh)
|
||||
GL.LineWidth(context.Material.ShaderArguments.Get("LineWidth", lineMesh.LineWidth));
|
||||
else if (context.Material.ShaderArguments.ContainsKey("LineWidth"))
|
||||
GL.LineWidth((float) context.Material.ShaderArguments["LineWidth"]);
|
||||
if (_canLineWidth)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (context.Mesh is ILineMesh lineMesh)
|
||||
GL.LineWidth(context.Material.ShaderArguments.Get("LineWidth", lineMesh.LineWidth));
|
||||
else if (context.Material.ShaderArguments.ContainsKey("LineWidth"))
|
||||
GL.LineWidth((float)context.Material.ShaderArguments["LineWidth"]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_canLineWidth = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (context.Material.Blending)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue