void RenderArea_PreRenderTargetUpdate(RenderTargetEvent_NativePtr evt) { // Random color Vector4 color = new Vector4((float)ran.NextDouble(), (float)ran.NextDouble(), (float)ran.NextDouble(), 1.0f); manualObj1.GetSection(0).SetCustomParameter(constantColor, color); manualObj1.Visible = true; manualObj2.Visible = false; }
protected void ResetOpacity() { try { TextureUnitState state = ManualObject.GetSection(0).GetMaterial().GetBestTechnique().GetPass(0).GetTextureUnitState(0); state.SetAlphaOperation(LayerBlendOperationEx.LBX_MODULATE, LayerBlendSource.LBS_TEXTURE, LayerBlendSource.LBS_MANUAL, 1.0f, 1.0f); } catch (Exception) { } }
public bool DecreaseOpacity(float o) { if (opacity < 0) { return(false); } opacity -= o; if (opacity < 0) { ManualObject.Visible = false; opacity = 0; return(false); } TextureUnitState state = ManualObject.GetSection(0).GetMaterial().GetBestTechnique().GetPass(0).GetTextureUnitState(0); state.SetAlphaOperation(LayerBlendOperationEx.LBX_MODULATE, LayerBlendSource.LBS_TEXTURE, LayerBlendSource.LBS_MANUAL, 1.0f, opacity); return(true); }