It is implemented to support alhpa in textures. Albedo's alpha channel works, but avoid using it for transparency. Pulsating light shader for round objects.This shader is based on the dot product between the face normal and the camera view vector, so it works best on smooth round surfaces with many triangles, ideally spheres.The shader has the following parameters:Albedo: base object color. This an alternative to the built in tilemap node for games that don't need all of it's features or need better performance when drawing a lot of tiles, the tilemap is rendered with a shader and performance depends on the resolution and the GPU, so the amount of tiles on the screen doesn't affect performance.How to use: editor supports basic things such as undo/redo, paint, erase and has a rectangle selection tool, brushes are made selecting things on the tileset view or from the selection on the map.-Node instance generation via custom scripts.-Autotiling-Flip tiles vertically and horizontally-Import maps from Tiled exported as json with csv tile data, the importer will ask you about which layer you want to import and what tileset you want to use.-Save and load brushes from filesSave and load maps from filesNotes:-Maps are stored as ImageTexture, if you are targeting mobile and low end devices don't use maps larger than 1024x1024 tiles( 2048x2048 should be fine but I'm not sure if that's good for low end mobile phones).-Tilesets can have a maximum size of 256x256 tiles.-Unfolding the image property of the ImageTexture that stores the map crashes the editor, this is a Godot editor bug.-Only one tileset can be used on a single GPUTilemap node, this is because shaders don't support sampler2d array uniforms on GLES2. Some optimization can be enabled in TileMapBrushPlugin, by OPTIMIZE field (you may not like to use it due to how it optimizes)(not sure it actually adds performance) ![]() Some optimization can be done on get_cell_info() - refresh once per mouse holdAdditional info:1. Some drawing points may be missed - due to mouse movement can be faster, than _physics_process' delta TileMap still draw single tiles (can be fixed with line drawing between last and new mouse position probably other solution can be found)3. There's no UndoRedo for what you draw with brush - it supposed to be original TileMap workflow but seems - it saves only 9 rounding tiles for undo, rest cannot be undone - use manual erase instead(I hope, solution will be found in future for that)2. Now, in editor - press 'Left Mouse Button' to draw, 'Right Mouse Button' to eraseKnown issues:1. Configure 'Script Variables' in inspector: * Draw/Erase Size (1 is default, and equals to 1 tile) * Draw/Erase Brush Type3. Add new child node to scene tree - called TileMapBrush2. Select a Sprite or any node with texture property and in Script Editor do File -> Run to generate a palette template.Ĭheck the example project for some usage examples or check the repo for more details.Provides editor's brush drawing functionality over TileMapHow to use it:0. It's an editor script for quick generating palettes from images. The shader comes bundled with a file PaletteGenerator.gd. Also, while the palette size is only limited by maximum texture size, having too many columns (hundreds/thousands) will impact performance. Warning: Be sure to import all used textures with "filter" disabled, otherwise the shader won't work properly. Only RGB values are sampled, alpha is used only for final image. When using palette alpha, keep in mind that transparent pixels are sampled too. ![]() You can use the alpha from palette colors or keep the original. I also made sure that the code is optimized. It uses integer comparison for the colors, so it's fast and perfectly accurate. ![]() The shader will automatically adjust to palette size, so it requires minimal setup (just drop palette image and it works). 2-row palette with first row skipped results in a static palette swap. ![]() By default, the reference row is also part of the animation, but it can be skipped. The shader will cycle between palette rows, resulting in an animation. Top row of palette are color references these colors are sampled from the original image and replaced by colors from subsequent rows. Palette swap shader with animation support 1.0 Shaders 3.4 CommunityĪ shader that changes sprite colors based on provided palette.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |