A vertex painting addon for the Godot game engine.

A vertex painting addon for the Godot game engine.

DOWNLOAD AND INSTALL:

Download the addon from https://github.com/tomankirilov/VPainter. Copy the addons folder in your project directory.
In Project/Project Settings/Plugins set VPainter to Active.

CHANGE LOG:

v0.2:

  • Added support for pressure sensitive pen tablets.
  • Some small bug fixes.

USING THE PLUGIN:


In the 3d editor when a MeshInstance node with a valid mesh resource is selected an icon will appear in the top editor menu.
When clicked a new sidebar will appear with painting options.

TOOLS:


brush tool : (Shortcut - "1") use to paint vertex colors. You can adjust the size with the sliders or by using "[" and "]"
picker tool: (Shortcut - "2") use to pick the vertex color under the mouse cursor when clicked.
blur tool : (shortcut - "3") in progress
fill tool : (shortcut - "4") use to fill the entire mesh with a color. Fill tool is affected by the opacity and blend mode.

color swatches: There are two color swatches. in the main panel. When clicked they reveal a color picker dialog. The last one clicked is the active one.

pressure sensitivity: There is a new option for pressure sensitive pen tablets.

  • SizePressure - the size of your brush depends on the pressure input.
  • OpacityPressure - the opacity of your brush depends on the pressure input.

blending modes: There are currently 5 blending modes supported:

  • MIX: linearly interpolated between the colors.
  • ADD: adds the colors.
  • SUBTRACT: subtracts the colors.
  • MULTIPLY: multiplies the colors.
  • DIVIDE: divides the colors.

size: controls the size of the brush and blur tool.
opacity: controls the opacity of the brush and fill tool.
hardness: controls the hardness of the brush and blur tool.
spacing : controls the spacing between the brush "dabs". Lower spacing results in a more precise line.

make local copy : makes a local copy of the mesh. It is useful if you don't want to overwrite your original mesh data.

LIMITATIONS:

  • Currently Vpainter does not support godot's primitive meshes. It only works with imported meshes.
  • Currently only RGB painting is supported. Alpha channel painting is in the works.
  • Currently Vpainter does not support meshes with multiple instances of floating geometry.

ADDITIONAL RESOURCES:

In VPainter/addons/vpainter/additional_resources/ you will find two shaders:

  • shader_vertex_color.shader:
    A simple shader that displays the vertex color. It has the possibility to isolate R, G and B channels so you can preview them individually.
  • height_blend_4_textures.shader:
    A shader used in the first presentation. It is used for mixing 4 textures based on a heightmap and vertex color.
    The shader uses 3 textures per material:
    • M: A mask texture.
      R channel contains the height information
      G channel contains the rougness information
      B channel contains the metal information.
    • C: RGB color/albedo information.
    • N: Normalmap information.

SOURCES:

Comments
  • Submit to the Godot asset library

    Submit to the Godot asset library

    Could you look into submitting this add-on to the Godot asset library? This will make it easier to discover. Thanks in advance :slightly_smiling_face:

  • Painting object with low number of vertices

    Painting object with low number of vertices

    Is there any way to paint objects with a low number of vertices? Im trying to paint a basic map consisting of cubes and prisms but the Vpainter only paints when hovering over a vertex and for example for a cube has only 8 points where you can paint

  • Add a project license

    Add a project license

    The repository currently doesn't seem to contain any license. Could you add one, please? See Choose a License for more information :slightly_smiling_face:

    For the record, most Godot plugins use the MIT license.

  • 2D?

    2D?

    2D vertex colors are edited using a list, so a tool would be greatly beneficial. Though in some ways 3D polygonal is better because with 2D AA isn't always available (in 3.1+ it's broken if HDR is on, not available in web. Also AA is not available at all for polygons in 4.0a last I checked).

    However in 2D you can animate polygons directly, both vertex positions and vertex colors... and frame or tweened style for either. So over all there's a wide possibility for style.

    I similarly would like more capability for dynamic vertex colors in 3D, but I do understand it's likely beyond the scope here. Or it might not even be viable to do. For more info, a thread here.

  • Shader triplanar

    Shader triplanar

    This project helped me a lot, so I'm here to give my contribution, based on some github code, and some changes I created a triplanar shader, it needs some adjustments, but I would like it to be implemented in the project, here is the code:

    [gd_resource type="Shader" format=2]
    
    [resource]
    code = "/*----------------------
    HEIGHTBLEND SHADER v1.0:
    ------------------------
    The shader uses 3 textures per material:
    	* M: A mask texture. R channel contains the height information, G channel contains the rougness information and B channel contains the metal information.
    	* C: RGB color/albedo information.
    	* N: Normalmap information.
    ------------------------
    ------------------------*/
    shader_type spatial;
    
    uniform float uv_scale:hint_range(0.01, 100.0) = 1;
    
    uniform float UV_SCALE1:hint_range(0, 1000) = 1;
    uniform sampler2D c1:hint_albedo;
    uniform sampler2D n1:hint_normal;
    
    uniform float UV_SCALE2:hint_range(0, 1000) = 1;
    uniform sampler2D c2:hint_albedo;
    uniform sampler2D n2:hint_normal;
    
    uniform float UV_SCALE3:hint_range(0, 1000) = 1;
    uniform sampler2D c3:hint_albedo;
    uniform sampler2D n3:hint_normal;
    
    uniform float UV_SCALE4:hint_range(0, 1000) = 1;
    uniform sampler2D c4:hint_albedo;
    uniform sampler2D n4:hint_normal;
    
    uniform float blend_softness1:hint_range(0.01, 1.0) = 0.025;
    uniform float blend_softness2:hint_range(0.01, 1.0) = 0.025;
    uniform float blend_softness3:hint_range(0.01, 1.0) = 0.025;
    
    
    vec3 heightblend(vec3 input1, float height1, vec3 input2, float height2, float softness){
    	float height_start = max(height1, height2) - softness;
    	float level1 = max(height1 - height_start, 0);
    	float level2 = max(height2 - height_start, 0);
    
    	return ((input1 * level1) + (input2 * level2)) / (level1 + level2);
    }
    
    vec3 heightlerp(vec3 input1, float height1, vec3 input2, float height2,float softness, float t ){
    	t = clamp(t, 0.0 , 1.0);
        return heightblend(input1, height1 * (1.0 - t), input2, height2 * t, softness);
    }
    
    vec3 random(vec3 coord)
    {
    	vec3 res;
    	res.x = fract(sin(dot(coord.yz, vec2(12.9898,78.233))) * 43758.5453123);
    	res.y = fract(sin(dot(coord.xz, vec2(16.6539,68.698))) * 69845.5962848);
    	res.z = fract(sin(dot(coord.xy, vec2(25.5263,41.256))) * 42538.6985436);
    	return res;
    }
    
    vec3 triPlanarTexture(float scale,vec4 projected_coords, vec3 color_offset, vec3 normal_weights, sampler2D text ){
    	float real = (1000.0 - scale)/1000.0;
    	vec3 mask10 = texture(text, projected_coords.zy*real).rgb;
    	vec3 mask11 = texture(text, projected_coords.xz*real).rgb;
    	vec3 mask12 = texture(text, projected_coords.xy*real).rgb;
    	
    	return mix(vec3(0.0f), mix((mask10 * normal_weights.x + mask11 * normal_weights.y + mask12 * normal_weights.z), color_offset.rgb, 0.05f), 1.0f);
    }
    
    
    void fragment(){
    	
    	vec4 projected_coords = CAMERA_MATRIX * vec4(VERTEX, 1.0);
    	
    	vec3 world_normal = abs(CAMERA_MATRIX * vec4(NORMAL, 0.0)).xyz;
    	vec3 normal_weights = world_normal / (world_normal.x + world_normal.y + world_normal.z);
    	vec3 color_offset = random(floor(projected_coords.xyz));
    	
    	
    	vec3 mask1 = vec3(1.0, 1.0, 1.0);
    	vec3 mask2 = vec3(1.0, 1.0, 1.0);
    	vec3 mask3 = vec3(1.0, 1.0, 1.0);
    	vec3 mask4 = vec3(1.0, 1.0, 1.0);
    
    	vec3 col1 = triPlanarTexture(UV_SCALE1, projected_coords, color_offset, normal_weights, c1);
    	vec3 col2 = triPlanarTexture(UV_SCALE2, projected_coords, color_offset, normal_weights, c2);
    	vec3 col3 = triPlanarTexture(UV_SCALE3, projected_coords, color_offset, normal_weights, c3);
    	vec3 col4 = triPlanarTexture(UV_SCALE4, projected_coords, color_offset, normal_weights, c4);
    	
    	vec3 nor1 = triPlanarTexture(UV_SCALE1, projected_coords, color_offset, normal_weights, n1);
    	vec3 nor2 = triPlanarTexture(UV_SCALE2, projected_coords, color_offset, normal_weights, n2);
    	vec3 nor3 = triPlanarTexture(UV_SCALE3, projected_coords, color_offset, normal_weights, n3);
    	vec3 nor4 = triPlanarTexture(UV_SCALE4, projected_coords, color_offset, normal_weights, n4);
    
    
    
    	vec3 m_blend1 = heightlerp(mask1.rgb, mask1.r, mask2.rgb, mask2.r, blend_softness1, COLOR.r);
    	vec3 m_blend2 = heightlerp(m_blend1.rgb, m_blend1.r, mask3.rgb, mask3.r, blend_softness2, COLOR.g);
    	vec3 m_blend3 = heightlerp(m_blend2.rgb, m_blend2.r, mask4.rgb, mask4.r, blend_softness3, COLOR.b);
    	
    	vec3 c_blend1 = heightlerp(col1.rgb, mask1.r, col2.rgb, mask2.r, blend_softness1, COLOR.r);
    	vec3 c_blend2 = heightlerp(c_blend1.rgb, m_blend1.r, col3.rgb, mask3.r, blend_softness2, COLOR.g);
    	vec3 c_blend3 = heightlerp(c_blend2.rgb, m_blend2.r, col4.rgb, mask4.r, blend_softness3, COLOR.b);
    
    	vec3 n_blend1 = heightlerp(nor1.rgb, mask1.r, nor2.rgb, mask2.r, blend_softness1, COLOR.r);
    	vec3 n_blend2 = heightlerp(n_blend1.rgb, m_blend1.r, nor3.rgb, mask3.r, blend_softness2, COLOR.g);
    	vec3 n_blend3 = heightlerp(n_blend2.rgb, m_blend2.r, nor4.rgb, mask4.r, blend_softness3, COLOR.b);
    	
    	ALBEDO = c_blend3.rgb;
    	NORMALMAP = n_blend3.rgb;
    	ROUGHNESS = m_blend3.g;
    	METALLIC = m_blend3.b;
    }"
    

    Tested in Godot 3.4

  • Interest in MaterialX and VPainter?

    Interest in MaterialX and VPainter?

    I proposed adding MaterialX to Godot Engine. Would you be interested in this sort of integration?

    1. https://github.com/godotengine/godot-proposals/issues/714
    2. https://github.com/materialx/MaterialX
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022
FlappyCalf - a game powered by Go+ spx game engine
FlappyCalf - a game powered by Go+ spx game engine

FlappyCalf - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this

Nov 6, 2022
MazePlay - a game powered by Go+ spx game engine
MazePlay - a game powered by Go+ spx game engine

MazePlay - a game powered by Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this g

Dec 16, 2021
Regolith is an Addon Compiler for the Bedrock Edition of Minecraft.

Much like bridge v2, Regolith introduces the concept of a "project folder", where your addons are written, including the RP, the BP, and any models, textures or configuration files. This single-folder-structure is great for version control, and allows you to keep your "source-of-truth" outside of com.mojang.

Nov 13, 2022
A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!
A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy!

galactic-asteroid-belt Overview A simple game that I created with Ebiten game library as a way to teach myself Go. Enjoy! Run To run, you will need Go

Dec 2, 2021
RundQuiz-Game - This is a Go exercise that implements and builds a quiz game from a list of math questions in a CSV file.

Go RundQuiz Game Exercise details This exercise is broken into two parts to help simplify the process of explaining it as well as to make it easier to

Jan 5, 2022
Simple 2D game to teach myself various things about game development and ECS, etc

2d-grass-game I really don't know what to name this game. Its a big grass field, and its in 2d so....2D Grass game This is a simple 2D game to teach m

Jan 17, 2022
Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Dec 26, 2022
Go 3D Game Engine
Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

Jan 9, 2023
Scalable Distributed Game Server Engine with Hot Swapping in Golang
Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Dec 25, 2022
A pure Go game engine
A pure Go game engine

Oak A pure Go game engine Table of Contents Installation Motivation Features Support Quick Start Implementation and Examples Finished Games Installati

Jan 8, 2023
Terminal-based game engine for Go, built on top of Termbox
Terminal-based game engine for Go, built on top of Termbox

Termloop Termloop is a pure Go game engine for the terminal, built on top of the excellent Termbox. It provides a simple render loop for building game

Dec 29, 2022
A 2D ARPG game engine.
A 2D ARPG game engine.

Abyss Engine is an ARPG game engine in the same vein of the 2000's games, and supports playing games similar to Diablo 2. The engine is written in golang and is cross platform. This engine does not ship with game specific files, and will require a game's assets in order to run.

Dec 24, 2022
A small fantasy game engine in WASM using GoLang
A small fantasy game engine in WASM using GoLang

The GoLang Fantasy Engine (GoLF Engine) is a retro game engine. It draws inspiration from fantasy console projects like pico-8, tic-80, and pyxle. Like those projects it is designed to be a retro-feeling game creation/playing tool. Unlike those projects GoLF is more minimal in scope and only provides an API and a small set of tools to help you create your games. Tools like an image editor and code editor are not built in. Despite this minimalism creating games in GoLF is still easy and should still maintain the retro game feel.

Jul 16, 2022
golang powered game engine
golang powered game engine

Gobatch Go powered engine that offers features from low level opengl abstraction to UI framework. I created this to separate lot of logic from game am

Nov 13, 2022
spx - A 2D Game Engine for learning Go+
spx - A 2D Game Engine for learning Go+

spx - A 2D Game Engine for learning Go+ Tutorials How to run spx tutorials? Download Go+ and build it. See https://github.com/goplus/gop#how-to-build.

Dec 1, 2022
Go Game Engine using SDL for fun

nMage nMage is a (hopefully!) high performance 3D Game Engine written in Go being developed live, with recordings posted on YouTube. This project is b

Nov 30, 2022
HelloSpx - Hello world of Go+ spx game engine
HelloSpx - Hello world of Go+ spx game engine

HelloSpx - Hello world of Go+ spx game engine How to run Download Go+ and build it. See https://github.com/goplus/gop#how-to-build. Download this game

Nov 27, 2021
HelloWorldForSpx - Hello world of Go+ spx game engine
 HelloWorldForSpx - Hello world of Go+ spx game engine

HelloWorldForSpx - Hello world of Go+ spx game engineHelloWorldForSpx - Hello world of Go+ spx game engine

Nov 22, 2021