chunky-dev / chunky-dev/chunky-opencl

OpenCL Preview is just a gray screen in new Chunky snapshots

Open
#4 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
19
Forks
3
PR merge metrics
No merged PRs in 30d

Description

**Hellos,**

I've been trying out the OpenCL plugin with the latest Chunky 2.5.0 snapshot (chunky-core-2.5.0-SNAPSHOT.381.gf277ba6), and the preview renderer just shows a solid gray/black (depending on what sky I choose) screen instead of the scene. The main path tracer might have issues too, but the preview is definitely broken.

I did some basic troubleshooting by simplifying the OpenCL code that runs on the GPU with Github Copilot:

1. Made it output solid red: **Worked!** The screen turned red. So the basic OpenCL stuff seems okay.
2. Made it output blue if a ray missed geometry, green if it hit: **Got solid blue.** Looks like the rays aren't hitting anything.
3. Made it color the screen based on the ray directions: **Got solid pinkish.** This seems weird, like all the rays are pointing the wrong way.
4. Made it color the screen based on the camera's orientation data: **Got solid yellow.** This also seems wrong, suggesting the camera orientation data being sent to the GPU is messed up in the new Chunky version.

So, it really looks like the main problem is that the plugin isn't getting the correct camera orientation from Chunky 2.5.0, causing the rays to go in the wrong direction and miss the scene entirely.

**Also, a separate bug:** While testing, I sometimes got this crash related to `blockMapping` being `null` when the scene resets:

```
java.lang.NullPointerException: Cannot read the array length because "blockMapping" is null
at dev.thatredox.chunkynative.opencl.renderer.ClSceneLoader.lambda$loadOctree$3(ClSceneLoader.java:69)
... (stack trace) ...
at dev.thatredox.chunkynative.opencl.renderer.OpenClPreviewRenderer.sceneReset(OpenClPreviewRenderer.java:121)
```

Maybe something changed in how the camera orientation is stored or accessed in the new snapshots, or I changed something in the code while trying to debug? And the `blockMapping` thing seems like a separate issue during scene loading.

Hope this helps track down the problem!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.