Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 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)
     {
     }
 }
Ejemplo n.º 3
0
        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);
        }