Skip to main content

Posts

Showing posts with the label shaders

Fake "reflective" material shader.

GODOT has a great shader system, and the roughness/metallic settings do a great job of representing a range of materials... but sometimes you want something a bit different. It is possible to have object specific "reflections", using a fairly old technique called "matcaps". It's not a particularly realistic looking effect, but if you want to go for that stylized effect, it can be a fun throwback. vec2 offset = (normal_map.xy) - vec2(0.5); vec2 v_n = (normal.xy / 2.0) + vec2(0.5, 0.5); v_n.y = (v_n.y * -1.0) + 1.0; v_n = v_n + offset;     vec4 refl = texture(mat_cap, v_n); Here 's the code you need for making the matcap project properly on your model. I've included a section to make sure the normal map will distort the reflections, just like with the metallic effect in GODOT. You can see in the image above that if we don't do this (left) the effect doesn't look good. Be sure to use the right import settings on your normal map textures, so that th...

Text crawl and other effects GLSL shader

For my project, I've been working on a kind of 80s style sci-fi monitor display.In game, this is going to be handled by a single texture effect with a GLSL shader. Different sections of the texture will be cut down and used on different view screens. Here's a preview of how it looks in action: Screen capture in Linux Mint is always a bit buggy. :( Or maybe it's because my computer is over ten years old... Here's another set of screens with different colors and contents, for the planet that the player gets to visit in the first episode (you can see in this preview how the "alert effect" is activated to change colors of the scan): You can see the original effect I'm trying to duplicate in the Star Trek movies: Anyway, it's a nice set of old school effects, and I'm going to explain how they are achieved in a game engine with a GLSL shader (In this case, GODOT, and awesome free game engine). First you need to set up the different layers of your image. ...

Project Lemonade December Update

It's the beginning of December, and I don't know how much work I'll get to do on the project this month. So I'm posting an update now, and another one maybe in January. I've been working with GLSL shaders to create the outdoor terrain. There's now a texture splatted ground plane, animated grass, animated trees and animated water. The textures are just placeholders for now, and all the models are temporary. Right at the moment, I'm just working on how the elements are going to be coded in the game, so later some better quality assets can just be dropped in to replace those being used for testing. Some of the shader code I used was inspired by examples found here .