Skip to content

Commit

Permalink
Update docs for v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SpockBauru committed Apr 1, 2024
1 parent 7735028 commit 09e696e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 39 deletions.
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@ Create a grid of Lightmap Probes and cut unwanted ones!

LightmapProbeGrid is an extension for [Godot Engine](https://godotengine.org/) that helps on the demanding task of placing Lightmap Probes where LightmapGI fails to do it.

**Disclaimer:** If you are getting the error `scene/3d/lightmap_gi.cpp:529 - Inconsistency found in triangulation...` is because [Godot Issue 82642](https://github.com/godotengine/godot/issues/82642) which cause probes to not be connected correctly resulting in inconsistencies on character lighting.
**Disclaimer:** If you are getting the error `scene/3d/lightmap_gi.cpp:529 - Inconsistency found in triangulation...` is because [Godot Issue 82642](https://github.com/godotengine/godot/issues/82642). If you have the knowledge, would you kindly contrubute to fix the issue please? \o/

### Video Tutorial
https://www.youtube.com/watch?v=IdpsFQpvp2I
https://www.youtube.com/watch?v=HzZSQ0BPpuk

# Index
* [What's new](#whats-new)
* [How to install](#how-to-install)
* [Making a grid of Light Probes](#making-a-grid-of-light-probes)
* [Cut Probes Based on Colliders](#cut-probes-based-on-colliders)
* [Cut Obstructed](#cut-obstructed)
* [Cut Obstructed Probes](#cut-obstructed-probes)
* [Cut probes inside objects](#cut-probes-inside-objects)
* [Cut probes far from objects](#cut-probes-far-from-objects)
* [Limitations](#limitations)
* [Compatibility](#compatibility)
* [Ending notes](#ending-notes)
* [Changelog](#changelog)

# What's New
Thanks to [dwarfses](https://twitter.com/dwarfses/status/1731691097263362513), LightmapProbeGrid v2.0 now uses GPU raycast instead of the regular Physics raycast. It may be slower but means that colliders are not needed anymore! If the camera can see, it should work!

NOTE: The Cull Mask from v1.0 is not compatible with v2.0.

# How to install
1) Extract the `addons` folder on the root of your project (`res://`). Other files/folders are optional.
2) Go to Godot's "Project" menu -> "Project Settings" -> "Plugins" tab -> enable "LightmapProbeGrid".
3) Restart Godot.
1) Download the file `LightmapProbeGrid_v2.0.zip` from the [Download Page](https://github.com/SpockBauru/LightmapProbeGrid/releases)
2) Extract the `addons` folder on the root of your project (`res://`). Other files/folders are optional.
3) Go to Godot's "Project" menu -> "Project Settings" -> "Plugins" tab -> enable "LightmapProbeGrid".
4) Restart Godot.

You can also open the `DemoScene` to see how it works.

Expand All @@ -34,40 +40,40 @@ You can also open the `DemoScene` to see how it works.

Now you can cut unwanted probes with the methods bellow.

# Cut Probes Based on Colliders
You can only cut probes based on objects that have colliders attached. This is because the tool relies on Raycast.

## Cut Obstructed
This method is designed to cut probes that are placed beyond collider limits such as the ground or the walls of a cave.
## Cut Obstructed Probes
This method is designed to cut probes that are placed beyond visual limits such as the ground or the walls of a cave.

On LightmapProbeGrid Inscpector click on "Cut Obstructed Probes". It will test each Light Probe from the center of the grid to the probe and see if the line intercepts an collision object. The probe will be cut if there's something blocking the line.
On LightmapProbeGrid Inscpector click on "Cut Obstructed Probes". It will test each Light Probe from the center of the grid to the probe and see if the line intercepts an object. The probe will be cut if there's something blocking the line.

## Cut probes inside objects
This method is designed to delete probes that are inside objects with colliders. It will test all 6 axis of each Light Probes: Up, Down, Left, Right, Forward and Backward by the distance indicated in `Max Object Size`.
This method is designed to delete probes that are inside objects. It will test all 6 axis of each Light Probe: Up, Down, Left, Right, Forward and Backward by the distance indicated in `Max Object Size`.

If at least 4 of these hit the same object the probe will be cut. It considers only 4 hits to cut probes on long objects like pillars and trees.
If at least 4 of these lines hit something the probe will be cut. It considers only 4 hits to cut probes on long objects like pillars and trees.

## Cut probes far from objects
This method is designed to delete probes that are far away from any collider. Normally these probes don't contain any relevant light information but use with care in places that have a high usage of spotlights.
This method is designed to delete probes that are far away from any object. Normally these probes don't contain any relevant light information but use with care in places that have a high usage of spotlights.

When you click the button the area around the Light Probe is tested on various directions by the distance indicated in `Max Distance`. The probe will be cut if none of the rays intercept an object.

## Using masks
You can select which layers the rays will interact on the Collision Mask section. Only selected layers will be used on detection for the Cut methods above.
You can select which 3D render layers LightmapProbeGrid will interact on the section Visual Cull Mask. Only selected layers will be used on detection for the Cut methods above.

Use masks to filter out objects to not interact with the rays, like characters or moving objects.

# Limitations
LightmapProbeGrid is not designed to work with a huge number of Light Probes at once covering a vast area. It is designed to be placed multiple times in a scene with relatively small grids (less than 1,000 probes).

Cutting probes relies on raycast which only works on object that have a collider. If the object doesn’t have a collider, it will not be tested for the cut.

# Compatibility
LightmapProbeGrid is compatible with Godot 4.2 and there are plans to continue supporting onward.

# Ending notes
This tool was entirely made on my free time. If you want to support me, please make an awesome asset and publish for free to the community!

# Changelog
v2.0:
- Major changes: now uses GPU Raycast instead of Physics raycast
- This means that colliders are not needed anymore!
- The Cull Mask from v1.0 is not compatible with v2.0

v1.0:
- First release.
44 changes: 25 additions & 19 deletions addons/lightmap_probe_grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@ Create a grid of Lightmap Probes and cut unwanted ones!

LightmapProbeGrid is an extension for [Godot Engine](https://godotengine.org/) that helps on the demanding task of placing Lightmap Probes where LightmapGI fails to do it.

**Disclaimer:** If you are getting the error `scene/3d/lightmap_gi.cpp:529 - Inconsistency found in triangulation...` is because [Godot Issue 82642](https://github.com/godotengine/godot/issues/82642) which cause probes to not be connected correctly resulting in inconsistencies on character lighting.
**Disclaimer:** If you are getting the error `scene/3d/lightmap_gi.cpp:529 - Inconsistency found in triangulation...` is because [Godot Issue 82642](https://github.com/godotengine/godot/issues/82642). If you have the knowledge, would you kindly contrubute to fix the issue please? \o/

### Video Tutorial
https://www.youtube.com/watch?v=IdpsFQpvp2I
https://www.youtube.com/watch?v=HzZSQ0BPpuk

# Index
* [What's new](#whats-new)
* [How to install](#how-to-install)
* [Making a grid of Light Probes](#making-a-grid-of-light-probes)
* [Cut Probes Based on Colliders](#cut-probes-based-on-colliders)
* [Cut Obstructed](#cut-obstructed)
* [Cut Obstructed Probes](#cut-obstructed-probes)
* [Cut probes inside objects](#cut-probes-inside-objects)
* [Cut probes far from objects](#cut-probes-far-from-objects)
* [Limitations](#limitations)
* [Compatibility](#compatibility)
* [Ending notes](#ending-notes)
* [Changelog](#changelog)

# What's New
Thanks to [dwarfses](https://twitter.com/dwarfses/status/1731691097263362513), LightmapProbeGrid v2.0 now uses GPU raycast instead of the regular Physics raycast. It may be slower but means that colliders are not needed anymore! If the camera can see, it should work!

NOTE: The Cull Mask from v1.0 is not compatible with v2.0.

# How to install
1) Extract the `addons` folder on the root of your project (`res://`). Other files/folders are optional.
2) Go to Godot's "Project" menu -> "Project Settings" -> "Plugins" tab -> enable "LightmapProbeGrid".
3) Restart Godot.
1) Download the file `LightmapProbeGrid_v2.0.zip` from the [Download Page](https://github.com/SpockBauru/LightmapProbeGrid/releases)
2) Extract the `addons` folder on the root of your project (`res://`). Other files/folders are optional.
3) Go to Godot's "Project" menu -> "Project Settings" -> "Plugins" tab -> enable "LightmapProbeGrid".
4) Restart Godot.

You can also open the `DemoScene` to see how it works.

Expand All @@ -34,40 +40,40 @@ You can also open the `DemoScene` to see how it works.

Now you can cut unwanted probes with the methods bellow.

# Cut Probes Based on Colliders
You can only cut probes based on objects that have colliders attached. This is because the tool relies on Raycast.

## Cut Obstructed
This method is designed to cut probes that are placed beyond collider limits such as the ground or the walls of a cave.
## Cut Obstructed Probes
This method is designed to cut probes that are placed beyond visual limits such as the ground or the walls of a cave.

On LightmapProbeGrid Inscpector click on "Cut Obstructed Probes". It will test each Light Probe from the center of the grid to the probe and see if the line intercepts an collision object. The probe will be cut if there's something blocking the line.
On LightmapProbeGrid Inscpector click on "Cut Obstructed Probes". It will test each Light Probe from the center of the grid to the probe and see if the line intercepts an object. The probe will be cut if there's something blocking the line.

## Cut probes inside objects
This method is designed to delete probes that are inside objects with colliders. It will test all 6 axis of each Light Probes: Up, Down, Left, Right, Forward and Backward by the distance indicated in `Max Object Size`.
This method is designed to delete probes that are inside objects. It will test all 6 axis of each Light Probe: Up, Down, Left, Right, Forward and Backward by the distance indicated in `Max Object Size`.

If at least 4 of these hit the same object the probe will be cut. It considers only 4 hits to cut probes on long objects like pillars and trees.
If at least 4 of these lines hit something the probe will be cut. It considers only 4 hits to cut probes on long objects like pillars and trees.

## Cut probes far from objects
This method is designed to delete probes that are far away from any collider. Normally these probes don't contain any relevant light information but use with care in places that have a high usage of spotlights.
This method is designed to delete probes that are far away from any object. Normally these probes don't contain any relevant light information but use with care in places that have a high usage of spotlights.

When you click the button the area around the Light Probe is tested on various directions by the distance indicated in `Max Distance`. The probe will be cut if none of the rays intercept an object.

## Using masks
You can select which layers the rays will interact on the Collision Mask section. Only selected layers will be used on detection for the Cut methods above.
You can select which 3D render layers LightmapProbeGrid will interact on the section Visual Cull Mask. Only selected layers will be used on detection for the Cut methods above.

Use masks to filter out objects to not interact with the rays, like characters or moving objects.

# Limitations
LightmapProbeGrid is not designed to work with a huge number of Light Probes at once covering a vast area. It is designed to be placed multiple times in a scene with relatively small grids (less than 1,000 probes).

Cutting probes relies on raycast which only works on object that have a collider. If the object doesn’t have a collider, it will not be tested for the cut.

# Compatibility
LightmapProbeGrid is compatible with Godot 4.2 and there are plans to continue supporting onward.

# Ending notes
This tool was entirely made on my free time. If you want to support me, please make an awesome asset and publish for free to the community!

# Changelog
v2.0:
- Major changes: now uses GPU Raycast instead of Physics raycast
- This means that colliders are not needed anymore!
- The Cull Mask from v1.0 is not compatible with v2.0

v1.0:
- First release.
2 changes: 1 addition & 1 deletion addons/lightmap_probe_grid/lightmap_probe_grid.gd
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func add_GPU_raycaster(probe: Node3D) -> void:
depth_mesh.size = Vector2.ONE * 0.001
camera_3d.add_child(depth_filter)
depth_filter.set_owner(root_node)
depth_filter.position = Vector3(0.,0., -0.002)
depth_filter.position = Vector3(0, 0, -0.002)
depth_filter.rotation = Vector3.ZERO


Expand Down

0 comments on commit 09e696e

Please sign in to comment.