openframeworks / openframeworks/openFrameworks

Duplicate symbols with ofxVolumetrics and Emscripten (I have a solution, but not a good one)

Open
#7,212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

emscripten
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

The good news is, texture3D works with OF and Emscripten (but not with all devices / GPUs).
For that, I had to change some things in ofxVolumetrics: https://github.com/Jonathhhan/ofxVolumetrics/tree/emscripten
But I still had some duplicate symbols because of ofxTextureData3d which accesses ofTextureData
class ofxTextureData3d : public ofTextureData
I solved it with adding this line to config.emscripten.default.mk:
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/gl/ofTexture.cpp
Somehow it works not to exclude ofTexture3d.cpp instead (which would be nicer, because it does not break other apps).
But it would be even nicer, if that issue is solvable in the addon (I will also ask the author).
Here is my 3d game of life compiled with Emscripten (as a test): https://volumetrics.handmadeproductions.de/
https://github.com/Jonathhhan/ofEmscriptenExamples/tree/main/emscriptenGameOfLife3d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with config.emscripten.default.mk and the openFrameworks GL sources named in the report: ofTexture.cpp and ofTexture3d.cpp. Reproduce the duplicate-symbol build with ofxVolumetrics and Emscripten, then compare the exclusion behavior and verify that the fix does not break other applications.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.