Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
- Fix CI badge not showing status.
- Mention that tutorials are outdated
- Add version badge
- Consistent header style and better whitespace use
  • Loading branch information
limbonaut authored and limbonaut committed Jan 19, 2024
1 parent c36f462 commit 6427289
Show file tree
Hide file tree
Showing 12 changed files with 246 additions and 182 deletions.
61 changes: 37 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
SmartShape2D
---
# SmartShape2D

![Sample Image]( ./addons/rmsmartshape/documentation/imgs/sample.png )
![Sample Gif]( ./addons/rmsmartshape/documentation/imgs/sample.gif )

[![🔎 Unit Tests](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/unit_tests.yml)
## About

![Godot 4.2](https://img.shields.io/badge/Godot-v4.2.x-%23478cbf?logo=godot-engine&logoColor=white)
[![⚙️ CI](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/ci.yml/badge.svg)](https://github.com/SirRamEsq/SmartShape2D/actions/workflows/ci.yml)

# About
**This is the GODOT 4 version of this plugin.
If you're looking for the GODOT 3 version, please go [here](https://github.com/SirRamEsq/SmartShape2D/tree/Godot3-latest)**

Expand All @@ -25,29 +27,36 @@ Read the section below on Contributing and post an issue if one doesn't already

---

# Support
## Support

- Newest version is developed for Godot 4
- Older version is supported and tested on Godot 3.2
- Should work with later versions of Godot 3.x

# Demo
## Demo

A Sample Godot Project can be found here:
https://github.com/SirRamEsq/SmartShape2D-DemoProject

# Documentation
- [How To Install]( ./addons/rmsmartshape/documentation/Install.md )
- [Quick Start]( ./addons/rmsmartshape/documentation/Quickstart.md )
- [Using SmartShape2D with Godot 4.0](./addons/rmsmartshape/documentation/Godot4.md)
- [Migrating from 1.x]( ./addons/rmsmartshape/documentation/Migration.md )
- [Shapes]( ./addons/rmsmartshape/documentation/Shapes.md )
- [Toolbar]( ./addons/rmsmartshape/documentation/Toolbar.md )
- [Resources]( ./addons/rmsmartshape/documentation/Resources.md )
- [Normals]( ./addons/rmsmartshape/documentation/Normals.md )
- [Controls and Hotkeys]( ./addons/rmsmartshape/documentation/Controls.md )
- [FAQ]( ./addons/rmsmartshape/documentation/FAQ.md )
- [Version History]( ./addons/rmsmartshape/documentation/VersionHistory.md )

# Video Tutorials
## Documentation
> 🛈 Some documentation is outdated.
- [How To Install](./addons/rmsmartshape/documentation/Install.md)
- [Quick Start](./addons/rmsmartshape/documentation/Quickstart.md)
- [Using SmartShape2D with Godot 4](./addons/rmsmartshape/documentation/Godot4.md)
- [Shapes](./addons/rmsmartshape/documentation/Shapes.md)
- [Toolbar](./addons/rmsmartshape/documentation/Toolbar.md)
- [Resources](./addons/rmsmartshape/documentation/Resources.md)
- [Normals](./addons/rmsmartshape/documentation/Normals.md)
- [Controls and Hotkeys](./addons/rmsmartshape/documentation/Controls.md)
- [FAQ](./addons/rmsmartshape/documentation/FAQ.md)
- [Version History](./addons/rmsmartshape/documentation/VersionHistory.md)

## Video Tutorials

> 🛈 These tutorials are for Godot 3, and some things are different now.
> Please, check [using SmartShape2D with Godot 4](./addons/rmsmartshape/documentation/Godot4.md).
SmartShape2D + Aseprite tutorial can be found here (Thanks Picster!):

[![VideoTutorial](https://img.youtube.com/vi/r-pd2yuNPvA/0.jpg)](http://www.youtube.com/watch?v=r-pd2yuNPvA)
Expand All @@ -56,8 +65,10 @@ SmartShape2D tutorial can be found here (Thanks LucyLavend!):

[![VideoTutorial](https://img.youtube.com/vi/45PldDNCQhw/0.jpg)](https://www.youtube.com/watch?v=45PldDNCQhw)

# Contibuting
## Issues
## Contibuting

### Issues

If you have any suggestions or find any bugs, feel free to add an issue.

Please include the following three bits of information in each issue posted:
Expand All @@ -72,12 +83,14 @@ Some Guidelines for Issues:

Issues can be added [here](https://github.com/SirRamEsq/SmartShape2D/issues)

## Development
### Development

We have a set of tests we run against the code (courtesy of [GUT](https://github.com/bitwes/Gut)).

If making a merge request, please ensure that the tests pass. If the tests have been updated appropriately to pass, please note this in the merge request.

## Discord
### Discord

We have a Discord server for the plugin. https://discord.gg/mHWDPBD3vu

Here, you can:
Expand Down
14 changes: 9 additions & 5 deletions addons/rmsmartshape/documentation/Controls.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
SmartShape2D - Controls and Hotkeys
---
# SmartShape2D - Controls and Hotkeys

<!-- TODO: Likely, outdated. Should this even be covered in such detail? -->

## Controls - Point Create

# Controls - Point Create
- Add Point
- Left Click Anywhere in the viewport

- Leave Point Create Mode
- ESCAPE

# Controls - Point Edit
## Controls - Point Edit

- Add Point
- Either:
- Hold ALT and Left Click Anywhere in the viewport
Expand All @@ -33,7 +36,8 @@ SmartShape2D - Controls and Hotkeys
- Hold SHFT + ALT and click
- The location of the click will be the the first point of a newly created Shape Node

## Overlap
### Overlap

When multiple points and edges overlap, it can be ambiguous what clicking will do.
SmartShape adheres the following rules:
- If a control point overlaps a vertex, the control point takes priority
Expand Down
18 changes: 11 additions & 7 deletions addons/rmsmartshape/documentation/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
SmartShape2D - FAQ
---
# SmartShape2D - FAQ

<!-- TODO: Outdated. -->

## Why aren't my textures repeating?

# Why aren't my textures repeating?
If your textures aren't repeating and look something like this:

![Non-Repeating-Texture-IMG]( ./imgs/faq-texture-repeat.png )
![Non-Repeating-Texture-IMG](./imgs/faq-texture-repeat.png)

The issue is most likely that you need to set the texture's import options in Godot:

![Import-Texture-Settings]( ./imgs/faq-texture-repeat-import.png )
![Import-Texture-Settings](./imgs/faq-texture-repeat-import.png)

## Why isn't my shape updaing when I change the Light Mask?

# Why isn't my shape updaing when I change the Light Mask?
Each shape is currently rendered by multiple-subnodes (Children Node2Ds).
Their owner isn't set, making them invisible in the editor (unless you have debug mode on).

Expand All @@ -30,7 +33,8 @@ If you need to manually tell the shape to update its rendering, call the set\_as
If anyone has any insights on this issue, please feel free to open an issue on this subject
and let us know how we might be able to fix it

# Why does changing the width look so ugly?
## Why does changing the width look so ugly?

Changing the width of the quads generally looks best with welding turned off.

If welding is on, you can still change the width of the quads, but you may need to play with it a bit.
Expand Down
13 changes: 6 additions & 7 deletions addons/rmsmartshape/documentation/Godot4.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Using SmartShape2D with Godot 4.0
---
# Using SmartShape2D with Godot 4

Godot 4 no longer offers `repeat` import option for textures. On how to make textures repeat and
Godot 4 no longer offers `repeat` import option for textures. On how to make textures repeat and
set normal maps see [section below.](#repeating-textures-and-normal-textures-with-canvastexture)

By default, **shape resources are shared** when the shape is copy-pasted. Editing points will edit every copy of that shape.
Expand All @@ -11,17 +10,17 @@ To make point geometry unique, press **"Make Unique"** property button in Geomet

## Repeating Textures and Normal Textures with CanvasTexture

Normal textures are no longer set in a material resource.
Normal textures are no longer set in a material resource.

To set normal textures, you can create a `CanvasTexture` resource in the inspector on any property, that allows setting a `Texture2D`.
To set normal textures, you can create a `CanvasTexture` resource in the inspector on any property, that allows setting a `Texture2D`.

![Creating CanvasTexture](imgs/godot4-create-texture-res.png)

`CanvasTexture` allows you to assign diffuse texture and normal map texture, as well as set textures to `repeat`:

![Assigning Texture, Normal Map and Setting Repeat flag](img/../imgs/godot4-assign-normal-tex.png)

## Converting Projects to Godot 4.0
## Converting Projects from Godot 3.x

Scene files with shapes saved in Godot 3.x should load in Godot 4 project. However, you may encounter some issues. Here is a list of expected problems:
1. Textures are looking weird, not repeated.
Expand All @@ -31,5 +30,5 @@ Please read the section on [how to set repeat and use normal textures in Godot 4

## Removed Features

- The Godot 4.0 version of this addon does not support 1.x RMSmartShape2D nodes anymore.
- The Godot 4 version of this addon does not support 1.x RMSmartShape2D nodes anymore.
- SS2D_Shape_Meta node was removed, since its functionality is available copy-pasted shapes by default.
25 changes: 13 additions & 12 deletions addons/rmsmartshape/documentation/Install.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
SmartShape2D - Install
---
# SmartShape2D - Install

## Asset Library

# Asset Library
- After installing the plugin, you may encounter an error, this is normal.
- You need to restart Godot before using the plugin
- You need to restart Godot before using the plugin.

# Manual Install
- Clone the repository at https://github.com/SirRamEsq/SmartShape2D/tree/godot-release
- Move the "addons/rmsmartshape" folder to your project's "addons" folder
- Open your project in Godot to have the addon install
## Manual Install

- Clone the repository at https://github.com/SirRamEsq/SmartShape2D.
- Move the "addons/rmsmartshape" folder to your project's "addons" folder.
- Open your project in Godot to have the addon install.
- After installing the plugin, you may encounter an error, this is normal.
- Restart Godot
- Restart Godot.

## Activate Plugin

# Activate Plugin
- After Installing the plugin, activate the plugin by navigating to Project -> Plugins
- After Installing the plugin, activate the plugin by navigating to `Project -> Project Settings... -> Plugins`

![Activate Plugin]( ./imgs/PluginActivate.png )
![Activate Plugin](./imgs/PluginActivate.png)
16 changes: 0 additions & 16 deletions addons/rmsmartshape/documentation/Migration.md

This file was deleted.

20 changes: 11 additions & 9 deletions addons/rmsmartshape/documentation/Normals.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Normals
---
# Normals

## Default Normals

# Default Normals
Even if you assign normal textures to your Edge Material, the normals will look wrong.

For example, consider the following image:

![Normals Wrong]( ./imgs/NormalWrong.png )
![Normals Wrong](./imgs/NormalWrong.png)

The normals in the image clearly don't line up with where the light is actually coming from.

# Encoding Normal data in the canvas_item Vertex Shader Color Parameter
## Encoding Normal data in the canvas_item Vertex Shader Color Parameter

As SmartShape renders the edges, the textures and their normal textures are also rotated.
This will result in incorrect normals.
To solve this, we can use a shader to correctly calculate the normals.
Expand All @@ -25,20 +26,21 @@ Vertex Shader's Color Parameter.

If we set the COLOR ENCODING value to "Normals", we get this:

![Normals wrong with weird diffuse colors]( ./imgs/NormalColors.png )
![Normals wrong with weird diffuse colors](./imgs/NormalColors.png)

Ok, so now the normals still look wrong, but the colors look wrong too. Great.

There is one final step before our normals will be correct. We need to decode the normal data in a shader.


# Writing a Shader
## Writing a Shader

You'll want to assign a new shader to the Edge Material's material property.
This shader will determine how each edge is rendered.

Here's a sample shader to decode our normal data and set our actual color to that of our diffuse texture:
```

```glsl
shader_type canvas_item;
varying mat2 NORMAL_MATRIX;
Expand All @@ -55,4 +57,4 @@ void fragment() {

After assigning this shader the the Edge Material's material property, our normals finally look right:

![Normals Correct]( ./imgs/NormalCorrect.png )
![Normals Correct](./imgs/NormalCorrect.png)
Loading

0 comments on commit 6427289

Please sign in to comment.