本文整理汇总了C#中Material.activateTexture方法的典型用法代码示例。如果您正苦于以下问题:C# Material.activateTexture方法的具体用法?C# Material.activateTexture怎么用?C# Material.activateTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Material
的用法示例。
在下文中一共展示了Material.activateTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: activateMaterialSelection
public Shader activateMaterialSelection(Material curMat)
{
int texunit = 0;
int handle = curMat.selectionshader.handle;
if (!curMat.selectionshader.loaded)
return curMat.selectionshader;
GL.UseProgram(handle);
curMat.activateTexture(Material.TexType.normalTexture, ref texunit, ref handle);
return curMat.selectionshader;
}
示例2: activateMaterial
public Shader activateMaterial(ref Material curMat)
{
int texunit = 0;
Shader shader = curMat.shader;
int handle = shader.handle;
Material.Propertys propertys = curMat.propertys;
if (!shader.loaded)
return shader;
GL.UseProgram(handle);
curMat.activateTexture(Material.TexType.baseTexture, ref texunit, ref handle);
curMat.activateTexture(Material.TexType.base2Texture, ref texunit, ref handle);
curMat.activateTexture(Material.TexType.base3Texture, ref texunit, ref handle);
curMat.activateTexture(Material.TexType.definfoTexture, ref texunit, ref handle);
curMat.activateTexture(Material.TexType.reflectionTexture, ref texunit, ref handle);
curMat.activateTexture(Material.TexType.normalTexture, ref texunit, ref handle);
shader.insertUniform(Shader.Uniform.fresnelExp, ref propertys.fresnelExp);
shader.insertUniform(Shader.Uniform.fresnelStr, ref propertys.fresnelStr);
activateWorldTexture(Material.WorldTexture.reflectionMap, ref texunit, handle);
shader.insertUniform(Shader.Uniform.in_eyepos, ref Scene.eyePos);
activateWorldTexture(Material.WorldTexture.lightMap, ref texunit, handle);
int emit = 0;
if (propertys.useEmit)
{
emit = 1;
//curMat.activateTexture(Material.TexType.emitTexture, ref curMat, ref texunit, handle);
shader.insertUniform(Shader.Uniform.in_emitcolor, ref propertys.emitMapTint);
/*
int emitBasealpha = 0;
if (propertys.emitMapAlphaBaseTexture)
emitBasealpha = 1;
int emitNormalalpha = 0;
if (propertys.emitMapAlphaNormalTexture)
emitNormalalpha = 1;
shader.insertUniform(Shader.Uniform.emit_a_normal, ref emitNormalalpha);
shader.insertUniform(Shader.Uniform.emit_a_base, ref emitBasealpha);
shader.insertUniform(Shader.Uniform.in_emitcolor, ref propertys.emitMapTint);
if (curMat.envMapTexture != 0)
{
GL.ActiveTexture(TextureUnit.Texture0 + texunit);
GL.BindTexture(TextureTarget.Texture2D, curMat.envMapTexture);
GL.Uniform1(GL.GetUniformLocation(handle, "envMapTexture"), texunit);
texunit++;
}
* */
}
shader.insertUniform(Shader.Uniform.use_emit, ref emit);
/*
int transparency = 0;
if (propertys.useAlpha)
{
transparency = 1;
shader.insertUniform(Shader.Uniform.ref_size, ref propertys.refStrength);
shader.insertUniform(Shader.Uniform.blur_size, ref propertys.blurStrength);
shader.insertUniform(Shader.Uniform.fresnel_str, ref propertys.fresnelStrength);
GL.ActiveTexture(TextureUnit.Texture0 + texunit);
GL.BindTexture(TextureTarget.Texture2D, this.Scene.backdropTextures[0]);
GL.Uniform1(GL.GetUniformLocation(handle, "backColorTexture"), texunit);
texunit++;
GL.ActiveTexture(TextureUnit.Texture0 + texunit);
GL.BindTexture(TextureTarget.Texture2D, this.Scene.backdropTextures[1]);
GL.Uniform1(GL.GetUniformLocation(handle, "backDepthTexture"), texunit);
texunit++;
}
shader.insertUniform(Shader.Uniform.use_alpha, ref transparency);
*/
if (propertys.noCull)
{
GL.Disable(EnableCap.CullFace);
}
else
{
GL.Enable(EnableCap.CullFace);
}
if (propertys.noDepthMask)
{
GL.DepthMask(false);
}
else
{
//.........这里部分代码省略.........