ROB TOM ROE
  • Home
  • Blog
  • Projects
  • Virtex Edge
  • Contact
March 27, 2016 by rtroe

Shader Porting to Linux MonoGame

Shader Porting to Linux MonoGame
March 27, 2016 by rtroe

One of the things which I wanted to implement in the Vertices Engine were Crepuscular Rays, more commonly known as God Rays. These have become ubiquitous in games within the last 5 years. Some games get it right, and add it lightly in to add a sense of depth and atmosphere to a game. Others over do it and wash out the screen (Looking at you Dishonored).

Crepuscular Rays in Metric Racer

The other post processing effect that’d been on my wishlist was Depth of Field.

Depth of Field Post Processing Shader under XNA

It wasn’t too difficult to get them running individually on their own  in little test projects, but integrating them into the engine was something I’d been putting off for a while.

After a weekend of tweaking, i managed to finally get them both integrated into the engine and working under XNA, but the true test of the simplicity of any code is being able to port it over to another platform.

Porting into Linux

MonoGame is great, but there’s a few nuances too porting shader code over well. One of the biggest is making sure global variables are initialised. In XNA if you have a *.fx file with a globalvariable such as:

float SpecularIntensity = 1

In MonoGame, you’ll need to re-initialise that value of of 1 in your *.cs file from C#.

part.Effect.Parameters[“SpecularIntensity“].SetValue(_specularIntensity);

This was a big head ache of chasing problems when I was porting over Bloom.

After a few tweaks in the *.fx files, they ported over too OpenGL without much more fuss than what I’d mentioned already. MonoGame has gotten to the level now where porting over is becoming easier and easier with each release.

Ported Depth of Field and Crepuscular Rays Post Process from #Windows into #Linux #MonoGame. It’s been a good day. pic.twitter.com/zPSOrP5eoA

— virte.c (@virte_c) March 27, 2016

 

Related

Previous articleOCC Tutorial 02 - Embedding OpenCascade into wxWidgetsNext article Pixel Art - Of a Time Gone By

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About The Blog

Nulla laoreet vestibulum turpis non finibus. Proin interdum a tortor sit amet mollis. Maecenas sollicitudin accumsan enim, ut aliquet risus.

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tags

3D 8-Bit AdMOb Ads android Animation Apollo Apollo 11 Audio Audio Puzzle C# Editor Electronics featured Game Dev Game Development Game Engine Gaming Github GLSL Graphics HLSL Japan Javascript Linux Mobile MonoGame NASA OpenGL Optimizations Programming Projects Screen Space Reflections Shaders Source Code SSR Terrain Editor tools Transparency Tutorial Vertices Virtex Edge Design WebGL wxWidgets XNA

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design

Tags

3D 8-Bit AdMOb Ads android Animation Apollo Apollo 11 Audio Audio Puzzle C# Editor Electronics featured Game Dev Game Development Game Engine Gaming Github GLSL Graphics HLSL Japan Javascript Linux Mobile MonoGame NASA OpenGL Optimizations Programming Projects Screen Space Reflections Shaders Source Code SSR Terrain Editor tools Transparency Tutorial Vertices Virtex Edge Design WebGL wxWidgets XNA
Rife Wordpress Theme. Proudly Built By Apollo13

ROB TOM ROE

I’m an Entrepreneur, Software Developer and Mechanical Engineering Grad. I started out working in the Energy and Nuclear safety sector as well as Aircraft Design, Repair and Stress analysis. In 2015 I started Virtex Edge Design , a software and game development company.

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design