Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Computer Graphics Demo 🎮✨

A MonoGame-based 3D graphics showcase featuring advanced shaders, post-processing effects, and interactive controls.

MonoGame .NET License

Demo Preview
Graphics Demo


🌟 Key Features

  • Dynamic Shader System
    • Real-time toggling of Diffuse/Specular/Normal mapping
    • Wireframe rendering mode
  • Post-Processing Effects
    • Black & White conversion
    • Underwater distortion with wave simulation
    • Blue tint effect
  • Scene Management
    • Space Fighter scene
    • Underwater scene
    • Custom skybox implementation
  • Interactive UI Controls
    • Parameter adjustment (amplitude, frequency)
    • Scene switching
    • Effect toggling

🛠️ Technical Implementation

Core Architecture

// Form1.cs - UI Control Handlers
private void DiffuseCB_CheckedChanged(object sender, EventArgs e) {
    _game.SetShaderOption("Diffuse", DiffuseCB.Checked);
}

private void AmplitudeTB_Scroll(object sender, EventArgs e) {
    double amplitudeValue = (double)AmplitudeTB.Value / 100;
    _game.SetPPValue("Amplitude", amplitudeValue);
}

Post-Processing Pipeline

// Game1.cs - Post-Processing Implementation
if (enableUnderwater) {
    BlackAndWhiteShader.Parameters["frequency"].SetValue(frequency);
    BlackAndWhiteShader.Parameters["amplitude"].SetValue(amplitude);
    BlackAndWhiteShader.Parameters["time"].SetValue(time);
    
    _spriteBatch.Begin(SpriteSortMode.Immediate, effect: BlackAndWhiteShader);
    _spriteBatch.Draw(sceneRenderTarget, Vector2.Zero, Color.White);
    _spriteBatch.End();
}

Shader System

Shader File Purpose
FighterShader.fx Space fighter material shading
UnderWaterPost.fx Underwater distortion effects
BWPost.fx Black & white conversion
CubeMap.fx Skybox rendering

🚀 Getting Started

Requirements Visual Studio 2022+

MonoGame Pipeline Tool

.NET 6.0 SDK

About

MonoGame + HLSL: multi-pass post-processing, normal and specular mapping

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages