Giter Club home page Giter Club logo

allolib's People

Contributors

aaronaanderson avatar akshay1992 avatar allosphere avatar fishuyo avatar grrrwaaa avatar hannahwolfe avatar konhyong avatar kybr avatar mantaraya36 avatar myunginlee avatar sihwapark avatar younkhg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

allolib's Issues

user flags example does not exemplify how to use flags.cmake

examples/user_flags/ should show how to use flags.cmake to cooperate with the build system to connect with some external system (e.g., Leap Motion SDK C++ API, MySQL C API, OpenCV C++ API). Instead, it presents code that does not even try to use an external system and a flags.cmake file that does not show how one might practically use a flags.cmake file.

The flags.cmake file shows that I can (and should?) set 4 variables: app_include_dirs, app_link_libs, app_definitions, and app_compile_flags. Are these the only variables I can set? What are some examples of how I might set them for a given external system? What useful variables do I have access to in this flags.cmake? For instance, do I know the project root folder path? Can I use relative paths to set these variables? Relative to where? (Again, where's the project root?)

use of `nav().pullBack(16);` is confusing

this method (pullBack) separates Nav position from camera/viewer position. while the effect is interesting and useful, the name of the function is misleading and the effect is confusing. Nav position is camera/viewer position. that's the rules. please explain and justify using this method in user code.

slash handling in the parameter class

//TODO: Add better heuristics for slash handling

What's wrong with letting the user manage all the slashes? Why try to figure out what they might have meant and correcting their (might be) errors? If this is the way that Parameter is going to work, then the class needs to loudly announce to the user "by using this class you are buying in to our ad-hoc OSC++ schema; you don't get to manage shashes."

Personally, I would much rather manage slashes myself.

Distributed/DynamicScene | communication between voice and app

i'm looking at dynamic_scene.cpp and distributed_scene.cpp because i need to spatialize some sounds and AudioScene is broken and deprecated. these classes seem to be awesomely synthesiser-oriented, but my application does not quite fit that use-case.

  • my voices don't move after they are placed; only the listener moves
  • my voices are always on while the app is running; no "notes" come and go
  • my voices use gam::SamplePlayer which allocates memory on load; this load should happen before the audio callback
  • each of my voices loads its own, specific sound file; voices are not fungible[1]
  • each of my voices needs to be drawn using a central, reused graphics resource rather than using voice-local member variables[2]

[1] i need a way to communicate between voice and app. i see that the way to do this is with parameters. i could do something like this, but i don't like it:

gam::SamplePlayer samplePlayer[N]; // global
...
struct SimpleVoice : PositionedVoice {
  ParameterInt whichSound {"whichSound"};
...
 virtual void onProcess(AudioIOData& io) override {
        while(io()){
            io.out(0) = soundFile[whichSound]();
        }
    }
...
// later in the app...
           auto whichSound = std::vector<int>{0};
           freeVoice->setParamFields(whichSound);

[2] this means that in the main apps onDraw, i would like to iterate through each active voice, querying its pose:

Mesh mesh;
Texture texture;
...
virtual void onDraw(Graphics& g) override {
  ...
  texture.bind();
  for (auto& v : scene.activeVoices()) {
    g.pushMatrix();
    g.translate(v.pos());
    g.rotate(v.quat());
    g.draw(mesh);
    g.popMatrix();
  }
  texture.unbind();
}
...

is there something like scene.activeVoices()??

ERROR: rtaudio linker error

-- Cuttlebone not found. Not building Cuttlebone.
/usr/local/lib/libfreetype.dylib  --------------- 
Undefined symbols for architecture x86_64:
  "_AudioDeviceCreateIOProcID", referenced from:
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
  "_AudioDeviceDestroyIOProcID", referenced from:
      RtApiCore::closeStream() in libal.a(RtAudio.cpp.o)
  "_AudioDeviceStart", referenced from:
      RtApiCore::startStream() in libal.a(RtAudio.cpp.o)
  "_AudioDeviceStop", referenced from:
      RtApiCore::closeStream() in libal.a(RtAudio.cpp.o)
      RtApiCore::stopStream() in libal.a(RtAudio.cpp.o)
  "_AudioObjectAddPropertyListener", referenced from:
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
  "_AudioObjectGetPropertyData", referenced from:
      RtApiCore::getDefaultInputDevice() in libal.a(RtAudio.cpp.o)
      RtApiCore::getDefaultOutputDevice() in libal.a(RtAudio.cpp.o)
      RtApiCore::getDeviceInfo(unsigned int) in libal.a(RtAudio.cpp.o)
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
      rateListener(unsigned int, unsigned int, AudioObjectPropertyAddress const*, void*) in libal.a(RtAudio.cpp.o)
  "_AudioObjectGetPropertyDataSize", referenced from:
      RtApiCore::getDeviceCount() in libal.a(RtAudio.cpp.o)
      RtApiCore::getDeviceInfo(unsigned int) in libal.a(RtAudio.cpp.o)
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
  "_AudioObjectHasProperty", referenced from:
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
  "_AudioObjectRemovePropertyListener", referenced from:
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
      RtApiCore::closeStream() in libal.a(RtAudio.cpp.o)
  "_AudioObjectSetPropertyData", referenced from:
      RtAudio::openRtApi(RtAudio::Api) in libal.a(RtAudio.cpp.o)
      RtApiCore::RtApiCore() in libal.a(RtAudio.cpp.o)
      RtApiCore::RtApiCore() in libal.a(RtAudio.cpp.o)
      RtApiCore::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, unsigned long, unsigned int*, RtAudio::StreamOptions*) in libal.a(RtAudio.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/yyy/tmp/AlloLib/examples/sound/bin/stereoscene] Error 1
make[1]: *** [CMakeFiles/stereoscene.dir/all] Error 2
make: *** [all] Error 2

This error prevents building examples on macOS 10.13 and 10.14.

The linker error above is not that helpful because we cannot see the linker command. See:

#5

-- karl

Create default config files for DistributedApp

A distributed_app.toml file should be created that reflects the environment where the application has run. It should create a simple desktop + nodes configuration template for unknown machines, and should create complete configurations for Allosphere and 2809.

Windows + Git Bash + Visual Studio C++ | build output is insanely noisy

I'm on Windows 10. I've installed git, cmake, and visual studio using chocolatey:

choco install git -y 
choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
choco install visualstudio2017-workload-vctools -y --package-parameters "--includeRecommended"

In this environment, the output of a successful execution of the run script dumps a LOT of noisy text into the terminal (like a bzillion very long lines). On the first execution that builds the whole of AlloLib, vctools spits out over 3 thousand warnings. Upon subsequent executions, a particular example might only dump 250 warnings. I think it might be useful for developers to actually look at some of these warnings, but I think that for users, these are just noise.

MacOS 10.15.1 (Catalina) Issues

Hello!

Having issues with running running an allolib playground example:
./run.sh allolib/examples/graphics/2D.cpp

At first had issues, stdio.h and math.h and assert.h and string.h could not be found.
Followed instructions from this stack overflow answer (https://stackoverflow.com/a/58349403) and created a symbolic link by using this command:

sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

This allowed the linker/compiler to find stdio.h, math.h, assert.h, string.h ...

But now the linker/compiler is complaining about other files:
fatal error: 'Carbon/Carbon.h' file not found
fatal error: 'CoreMIDI/CoreMIDI.h' file not found
fatal error: 'CoreAudio/AudioHardware.h' file not found
fatal error: 'IOKit/serial/ioss.h' file not found
fatal error: 'CoreAudio/AudioHardware.h' file not found

any ideas on how to proceed?

Thanks,
Philip

-v flag does not help in run.sh script

To support debugging we need to see the compile and linker lines. However, ./run.sh -v does not show these. What is -v for if not to show this information?

`examples/ui/dialog.cpp` | unexpected behaviour and crash

Judging just from the name, dialog.cpp (and al::Dialog), I expect this example and this class to open an OS-native window in order to ask something of the user (e.g., select a file, select an output folder, etc.). Instead, a second window appears with a flashing background and an ImGui debug window within it---How is that a "dialog"? What's more, when I trigger the "dialog" a second time, the example crashes. ?

I'm using macOS 10.14.2 Beta (18C31g).

This example does not have any comments or documentation. What is it supposed to show? How is an al::Dialog supposed to be used? What's it for?

example doesn't run

The example:

./run.sh allolib/external/Gamma/examples/effects/vibrato.cpp

does not run under allolib_playground on arm64 architecture. Produces these errors:

Undefined symbols for architecture arm64:
  "gam::AudioIO::framesPerBuffer(int)", referenced from:
      gam::AudioApp::AudioApp() in vibrato.cpp.o
  "gam::AudioIO::framesPerSecond(double)", referenced from:
      gam::AudioApp::AudioApp() in vibrato.cpp.o
  "gam::AudioIO::start()", referenced from:
      _main in vibrato.cpp.o
  "gam::AudioIO::append(gam::AudioCallback&)", referenced from:
      gam::AudioApp::AudioApp() in vibrato.cpp.o
  "gam::AudioIO::channels(int, bool)", referenced from:
      gam::AudioApp::AudioApp() in vibrato.cpp.o
      gam::AudioApp::AudioApp() in vibrato.cpp.o
  "gam::AudioIO::AudioIO(int, double, void (*)(gam::AudioIOData&), void*, int, int)", referenced from:
      gam::AudioApp::AudioApp() in vibrato.cpp.o
  "gam::AudioIO::~AudioIO()", referenced from:
      _main in vibrato.cpp.o
      MyApp::~MyApp() in vibrato.cpp.o
      MyApp::MyApp() in vibrato.cpp.o
      gam::AudioApp::AudioApp() in vibrato.cpp.o
      MyApp::~MyApp() in vibrato.cpp.o
  "gam::AudioIOData::framesPerBuffer() const", referenced from:
      MyApp::onAudio(gam::AudioIOData&) in vibrato.cpp.o
      MyApp::onAudio(gam::AudioIOData&) in vibrato.cpp.o
      MyApp::onAudio(gam::AudioIOData&) in vibrato.cpp.o
      MyApp::onAudio(gam::AudioIOData&) in vibrato.cpp.o
ld: symbol(s) not found for architecture arm64

Are we building it incorrectly, or is this an example that hasn't been kept up to date with changes in the code?

cling: experiments and exploration

We have already worked on this a bit. I thought I would start a record of the journey and a conversation.

For many reasons, it would be nice to interact with our framework from a REPL. cling (https://root.cern/cling/) offers an opportunity for that.

Thank you Andrés for your work on compiling shared libraries. This allows us to link in cling because (at the moment) cling only supports dynamic linking to shared libraries.

Here is the state of things on macOS 10.15.7 on Intel x64:

cd path/to/allolib
cling -std=c++14
****************** CLING ******************
* Type C++ code and press enter to run it *
*             Type .q to exit             *
*******************************************
[cling]$ #include "prelude.h" // takes a second
[cling]$ al::Vec3f v(al::rnd::uniform())
(al::Vec3f &) { 0.340817f, 0.340817f, 0.340817f }
[cling]$

I installed cling with brew install cling.

I compiled AlloLib after configuring the CMakeLists.txt. I turned on building shared libraries:

option(ALLOLIB_BUILD_SHARED "Build all libraries as shared libraries" ON)

Here is the contents of prelude.h:

// load libraries..
//
#pragma cling load("build/libal.dylib")
#pragma cling load("build/external/libimgui.dylib")
#pragma cling load("build/external/Gamma/libGamma.dylib")
#pragma cling load("build/external/rtmidi/librtmidi.dylib")
#pragma cling load("build/external/liboscpack.dylib")
#pragma cling load("build/external/rtaudio/librtaudio.dylib")
#pragma cling load("build/external/glad/libglad.dylib")
#pragma cling load("build/external/libserial.dylib")
#pragma cling load("build/external/glfw/src/libglfw.dylib")

// include PATHs
//
#pragma cling add_include_path("include")
#pragma cling add_include_path("external/Gamma")
#pragma cling add_include_path("external/glad/include")

// include headers
//
#include "al/app/al_App.hpp"
#include "al/math/al_Functions.hpp"
#include "al/math/al_Random.hpp"

If someone could try Linux and report back, it would be appreciated.

cling binaries and supporting libraries are hard to come by for Windows. My attempts to build cling.exe ended in failure (so far). This GitHub repository has binaries that worked for me:

https://github.com/boydingham/cling.for.windows

..but I would not ask others to trust the binaries of some random "author". If someone succeeds at building cling on windows or finds a reputable source of binaries, please report this. I will try to test on Windows with what I have.

`./run.sh examples/xxx/yyy.cpp` only executes the compiled program the first time it runs

Let's build and run with ./run.sh:

ix $ ./run.sh examples/graphics/lighting.cpp

...

[  0%] Linking C static library lib/libGLEW.a
[  1%] Built target glew_s
[  2%] Linking CXX static library lib/libGamma.a
[ 13%] Built target Gamma
[ 14%] Linking C static library libglfw3.a
[ 26%] Built target glfw
[ 27%] Linking CXX static library lib/libal.a
[ 98%] Built target al
Scanning dependencies of target lighting
[ 99%] Building CXX object CMakeFiles/lighting.dir/Users/ky/Projects/tmp/AlloLib/examples/graphics/lighting.cpp.o
[100%] Linking CXX executable /Users/ky/Projects/tmp/AlloLib/examples/graphics/bin/lighting
[100%] Built target lighting

A window opens; The program runs. We close the window and get our terminal back. Then we execute the same line again and again, but no window opens and our program does not run.

ix $ ./run.sh examples/graphics/lighting.cpp

...

Running target after build
[  1%] Built target glew_s
[ 13%] Built target Gamma
[ 26%] Built target glfw
[ 98%] Built target al
[100%] Built target lighting

After that first time, every subsequent ./run.sh invocation seems to do nothing.

Add License

It would be very helpful for packaging this.

Issue with oscpack

Trying to install and run allolib. Examples that do not require graphics work fine (eg: example_math_random) but examples that require Parameter OSC Handshake server like all the graphics examples do not. This issue has been produced on two of the new macs with M1 chips, but could not be reproduced with a mac with an i9 processor.

Assertion failed: (sizeof(osc::int32) == 4), function OutboundPacketStream, file /[path]/C++/allolib/external/oscpack/osc/OscOutboundPacketStream.cpp, line 166.
Abort trap: 6

Heres the error message generated by the macOS system:
Process: example_graphics_cieColor [75498]
Path: /Users/USER/Desktop/*/example_graphics_cieColor
Identifier: example_graphics_cieColor
Version: 0
Code Type: ARM-64 (Native)
Parent Process: bash [75445]
Responsible: Terminal [75442]
User ID: 502

Date/Time: 2022-05-30 13:53:19.048 -0400
OS Version: macOS 11.3.1 (20E241)
Report Version: 12

Crash on al::FBO::bind

#0 0x0000000000000000 in ?? ()
#1 0x000000000051c06a in al::FBO::bind (fboID=0) at /home/sphere/Code/allolib/src/core/graphics/al_FBO.cpp:127
#2 0x00000000004ca921 in al::RenderManager::framebuffer (id=0)
at /home/sphere/Code/allolib/src/core/graphics/al_RenderManager.cpp:101
#3 0x00000000004a53fa in al::App::preOnDraw (this=0x7fffffffd6a0)
at /home/sphere/Code/allolib/cmake/single_file/../../include/al/core/app/al_App.hpp:78
#4 0x00000000004a55cc in al::App::loop (this=0x7fffffffd6a0)
at /home/sphere/Code/allolib/cmake/single_file/../../include/al/core/app/al_App.hpp:106
#5 0x00000000004a5693 in al::App::start (this=0x7fffffffd6a0)
at /home/sphere/Code/allolib/cmake/single_file/../../include/al/core/app/al_App.hpp:121
#6 0x00000000004a41f6 in main () at /home/sphere/Code/allolib/examples/graphics/platonics.cpp:106

This is on:
Linux spherez05 4.4.0-112-generic #135-Ubuntu SMP Fri Jan 19 11:48:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

However on my Ubuntu laptop that has version 17.10, things work fine...

Feature Request|Head-Related Transfer Function binaural spatializer

The title says it all. We pull in the Zita convolver somewhere, correct? So the hard part is done! It seems like it should not be that hard to hack out something that fits the spatial audio API. Perhaps the example for HRTF would be the app that does a search/wizard to find the HRIR data that best fit your ears.

examples/graphics/mirror.cpp is not a mirror | complete or rename

examples/graphics/mirror.cpp is not a mirror. please complete or rename.

I checked: the calculation of the position of the "mirror camera" seems correct---It's just reflected across an axis. I checked this by rendering that position with a sphere. It seems to be in the right place.

I think perhaps the issue is that some of the other parameters of the "mirror camera" are not correct. Imagine a wire-frame frustum drawn from the mirror camera's perspective. (Or, maybe just literally render this wire-frame as a way to see how to repair this example.) The lines that define the frustum must run through the corners of the mirror surface (the textured quad). This frustum is oblique, No? It's an off-axis frustum (google: oblique frustum and off-axis frustum and look at the links at the end of this comment). The surface the camera projects onto is at an angle (not a right angle) with respect to the viewer. And, the field of view change as I move closer or further away from the mirror. Yet, here's how the mirror camera is setup:

    g.pushProjMatrix(Matrix4f::perspective(45, 1, 0.001, 100));
    g.pushViewMatrix(Matrix4f::lookAt(mirrorCam.ux(), mirrorCam.uy(),
                                      mirrorCam.uz(), mirrorCam.pos()));

To me, that looks like a camera with a fixed field of view projecting onto a surface that is always 90 degrees to the viewer. This is why this mirror looks good when I am looking at it head-on (90 degrees), but as I look at it from an angle, it looks wrong.

A (virtual) mirror is just a (virtual) window plus a reflection. In this example, the reflection part is correct (I think), but window part is wrong. I recommend we make a new example called window that illustrates the difference between toe-in and off-axis. This example would be very useful for teaching the basics of what some of the advanced stuff this framework does at its core: stereo, omni-stereo, projecting onto curved surfaces from odd angles. Getting these examples (e.g., mirror, window, other stuff that does off-axis projection) wrong should be particularly embarrassing for this framework :)

Image class only loads PNG files

It seems the directives in al_stb_image.cpp has changed to only accept PNG files.

#define STB_IMAGE_IMPLEMENTATION
#define STBI_ONLY_PNG
#include "stb_image.h"

I had to add #define STBI_ONLY_JPEG to enable the Image class to also load jpeg files.

I am wondering whether this change is intended or not.

Missing cmake file?

When testing allolib as shown in the readme:

git clone https://github.com/AlloSphere-Research-Group/allolib
cd allolib
git submodule init
git submodule update
./run.sh examples/graphics/2d.cpp

We get this error:

CMake Error at ../../CMakeLists.txt:144 (include):
  include could not find load file:

    cmake/example_targets.cmake

examples/graphics/asset.cpp cannot find its asset

xx $ ./run.sh examples/graphics/asset.cpp

...
Running target after build
CMake Warning:
  Manually-specified variables were not used by the project:

    AL_RUN_APP

[  1%] Linking C static library lib/libGLEW.a
[  2%] Built target glew_s
[  3%] Linking CXX static library lib/libGamma.a
[ 14%] Built target Gamma
[ 15%] Linking C static library libglfw3.a
[ 27%] Built target glfw
[ 28%] Linking CXX static library lib/libal.a
[ 99%] Built target al
Scanning dependencies of target asset
[100%] Building CXX object CMakeFiles/asset.dir/Users/xxx/Projects/tmp/AlloLib/examples/graphics/asset.cpp.o
[100%] Linking CXX executable /Users/xxx/Projects/tmp/AlloLib/examples/graphics/bin/asset
SearchPath 0x103f5c240 appPath: /Users/xxx/Projects/tmp/AlloLib/examples/graphics/bin/
SearchPath 0x103f5c240 path: /Users/xxx/Projects/tmp/AlloLib/examples/graphics/bin/data/ (recursive: 1)
SearchPath 0x103f5c240 path: /Users/xxx/Projects/tmp/AlloLib/examples/graphics/bin/ (recursive: 1)
reading
Info,  T0: Load
Error, T0: Unable to open file "".
error reading
[100%] Built target asset

asset.cpp refers to ducky.obj (FilePath path = searchpaths.find("ducky.obj");) but cannot find it:

find . -name ducky.obj # finds nothing
git lfs install
git lfs pull
find . -name ducky.obj # finds nothing

This asset should be added via git-lfs.

vbap implementation

triplet.s1=i;
triplet.s2=j;
triplet.s3=k;
//Only add triplet if its matrix is invertable
if(triplet.loadVectors(spkrs)){
}
triplets.push_back(triplet);
}
}
}

src/core/sound/al_Vbap.cpp, line from 168 to 170 seems not correct. Should the line with push_back go into the if block?

P

uniform mat4 P;

We really can't afford the extra characters it takes to spell out "projection" or "projectionMatrix"? MV instead of "modelViewMatrix"? You only have to type the long names once. forever after, you only type mod[TAB] or pro[TAB]. That's the case if you use a decent code editor. The verbosity is valuable for people who are learning. Students that look into the guts of this stuff, I'd like them to be able to have enough to google what they find.

Texture Point Sprite Example

I want to know how to do a cloud of points that obey perspective where each point is rendered as a texture. I've written this many times is the old system. It is a very common request from students.

However, I'm struggling to do this given the new system. In particular...

  1. I don't know whether the default shader system supports this use case. If it does, I don't know how to use it. I would assume, a) create a simple 16x16 pixel texture, b) create a point mesh, c) bind the texture, d) call g.texture() to use the default shader for textures, and e) win. But, this does not work for me.
  2. When I write my own shader, I have to use version 330 GLSL, so I adapted my shader which uses the old GLSL and fixed-pipeline "magic" variables. Again, I cannot get it to work for me, even though I think it should. I have something that compiles, but i don't see anything. Does one still need to call glEnable(GL_POINT_SPRITE) and glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE)??
  3. There is no example to follow that shows how to do this very, very common case.
  4. The "way" of doing graphics (i.e., default shaders concatenated as strings to cover common use cases) is still totally undocumented, so I (and others) are left to read the source and infer and deduce what might be the "right way" to use the default shader system.

Perhaps the "right way" to do a point sprite cloud is totally different than it used to be; Perhaps the "right way" is so radically different that I'm going about it all wrong. Perhaps I should be using instancing?

In any case, I need an example. Here's a non-texture-sprite cloud I wrote:

https://github.com/kybr/mat201b/blob/master/example/shader_point_cloud.cpp

Here's the current shader sprite example in AlloSystem

https://github.com/AlloSphere-Research-Group/AlloSystem/blob/devel/allocore/examples/graphics/shaderSprites.cpp

(Does it really have to use a geometry shader?)

Image::saveImage assumes the number of image channels as 3

This issue also happens with the devel branch commit 8a9ece2

When Image saves image data with Image::saveImage(), the saved image is corrupted because of wrongly specified stride bytes.

It is because the Image class assumes the data being saved has 3 channels whereas Image loads an image as 4 channels RGBA.

// in al_Image.cpp

bool Image::saveImage(std::string fileName, unsigned char *pixs, int width,
                      int height, bool flipVertically) {

  al_stbSetFlipVertically(flipVertically);
  return al_stbWriteImage(fileName.c_str(), pixs, width, height);
}
...

// in al_stb_image.cpp
bool al_stbWriteImage(const char *fileName, const unsigned char *data,
                      int width, int height) {
  return stbi_write_png(fileName, width, height, 3, data, width * 3) == 0;
}

Above are the actual functions called. I think saveImage and al_stbWriteImage need to have a parameter for the number of channels instead of hard-coded "3"s inside the function.

need check on al::Speaker's ctor signature

/// Current arrangement of speakers in AlloSphere
struct AlloSphereSpeakerLayout : public SpeakerLayout{
AlloSphereSpeakerLayout(){
const int numSpeakers = 54;
Speaker alloSpeakers[numSpeakers] = {
Speaker(1-1, -77.660913, 41.000000, 4.992118),
Speaker(2-1, -45.088015, 41.000000, 5.571107),
Speaker(3-1, -14.797289, 41.000000, 5.900603),
Speaker(4-1, 14.797289, 41.000000, 5.900603),
Speaker(5-1, 45.088015, 41.000000, 5.571107),
Speaker(6-1, 77.660913, 41.000000, 4.992118),
Speaker(7-1, 102.339087, 41.000000, 4.992118),
Speaker(8-1, 134.911985, 41.000000, 5.571107),
Speaker(9-1, 165.202711, 41.000000, 5.900603),

/// Spatial definition of a speaker in a listening space
///
/// @ingroup allocore
class Speaker {
public:
unsigned int deviceChannel; ///< Index in the output device channels array
float azimuth; ///< Angle from forward to left vector
float elevation; ///< Angle from forward-right plane to up vector
int group; ///< Group identifier
float radius; ///< Distance from center of listening space
float gain; ///< Gain of speaker
/// @param[in] deviceChan audio device output channel
/// @param[in] az azimuth of speaker
/// @param[in] el elevation of speaker
/// @param[in] radius radius of speaker
/// @param[in] gain gain of speaker
Speaker(unsigned int deviceChan=0, float az=0.f, float el=0.f, int group = 0, float radius=1.f, float gain=1.f)
: deviceChannel(deviceChan), azimuth(az), elevation(el), group(group), radius(radius), gain(gain)
{}

it seems that ctor signature of al::Speaker and its use case in AlloSphereSpeakerLayout does not match.

example/user_flags fails

trying to use the user_flags example, we add a library to link. we add the tcc line below:

# other libraries to link
set(app_link_libs
  tcc
)

(i don't know if this is the correct way to this. the example does provide an example of how to use this functionality.)

this results in the following cmake error:

...
+ cmake -G 'Unix Makefiles' -Wno-deprecated -DBUILD_EXAMPLES=0 -DCMAKE_BUILD_TYPE=Release -DAL_APP_FILE=../../../main.cpp -DAL_VERBOSE_OUTPUT=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DAL_APP_RUN=1 -DUSE_MPI=0 /Users/xx/yyyyy/AlloLib/./cmake/single_file
found flags.cmake
binary dir: /Users/xx/yyyyy/AlloLib/examples/user_flags/build/main/Release
file full path: /Users/xx/yyyyy/AlloLib/examples/user_flags/main.cpp
app path: /Users/xx/yyyyy/AlloLib/examples/user_flags
app name: main
al path: /Users/xx/yyyyy/AlloLib/cmake/single_file/../../../allolib
-- Cuttlebone not found. Not building Cuttlebone.
binary dir: /Users/xx/yyyyy/AlloLib/examples/user_flags/build/main/Release
file full path: /Users/xx/yyyyy/AlloLib/examples/user_flags/main.cpp
app path: /Users/xx/yyyyy/AlloLib/examples/user_flags
app name: main
al path: /Users/xx/yyyyy/AlloLib/cmake/single_file/../../../allolib
include dirs: extra
link libs: tcc
definitions: -DUSE_COLOR
compile flags: -Wno-unused-variable
linker flags: 
-- Cuttlebone not found. Not building Cuttlebone.
/usr/local/lib/libfreetype.dylib  --------------- 
found freeimage
found freetype
Using RtMidi
Using RtAudio
** Processing extensions **
libs: al_assets3d;/usr/local/lib/libassimp.dylib
OpenVR not found. Not building al_openvr extension.
libs: al_soundfile;/usr/local/lib/libsndfile.dylib
** DONE Processing extensions **
___ 
CMake Error at CMakeLists.txt:136 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "main".  All uses of target_link_libraries with a target must be
  either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:123 (target_link_libraries)

+ set +x
+ cmake --build . --target main_run --config Release -- -j3
/usr/local/Cellar/cmake/3.14.4/bin/cmake -S/Users/xx/yyyyy/AlloLib/cmake/single_file -B/Users/xx/yyyyy/AlloLib/examples/user_flags/build/main/Release --check-build-system CMakeFiles/Makefile.cmake 0
Re-run cmake file: Makefile older than: /Users/xx/yyyyy/AlloLib/examples/user_flags/flags.cmake
found flags.cmake
binary dir: /Users/xx/yyyyy/AlloLib/examples/user_flags/build/main/Release
file full path: /Users/xx/yyyyy/AlloLib/examples/user_flags/main.cpp
app path: /Users/xx/yyyyy/AlloLib/examples/user_flags
app name: main
al path: /Users/xx/yyyyy/AlloLib/cmake/single_file/../../../allolib
-- Cuttlebone not found. Not building Cuttlebone.
binary dir: /Users/xx/yyyyy/AlloLib/examples/user_flags/build/main/Release
file full path: /Users/xx/yyyyy/AlloLib/examples/user_flags/main.cpp
app path: /Users/xx/yyyyy/AlloLib/examples/user_flags
app name: main
al path: /Users/xx/yyyyy/AlloLib/cmake/single_file/../../../allolib
include dirs: extra
link libs: tcc
definitions: -DUSE_COLOR
compile flags: -Wno-unused-variable
linker flags: 
-- Cuttlebone not found. Not building Cuttlebone.
/usr/local/lib/libfreetype.dylib  --------------- 
found freeimage
found freetype
-- ==== Configuring Gamma.
-- Checking for module 'libsndfile'
--   No package 'libsndfile' found
-- Found SNDFILE 
-- libsndfile: /usr/local/lib/libsndfile.dylib
-- threading: 
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 
-- Using Cocoa for window creation
Using RtMidi
Using RtAudio
** Processing extensions **
libs: al_assets3d;/usr/local/lib/libassimp.dylib
OpenVR not found. Not building al_openvr extension.
-- Using libsndfile: /usr/local/lib/libsndfile.dylib
libs: al_soundfile;/usr/local/lib/libsndfile.dylib
-- Using fftw3: /usr/local/lib/libfftw3f.dylib
** DONE Processing extensions **
___ 
CMake Error at CMakeLists.txt:136 (target_link_libraries):
  The keyword signature for target_link_libraries has already been used with
  the target "main".  All uses of target_link_libraries with a target must be
  either all-keyword or all-plain.

  The uses of the keyword signature are here:

   * CMakeLists.txt:123 (target_link_libraries)

-- Configuring incomplete, errors occurred!
See also "/Users/xx/yyyyy/AlloLib/examples/user_flags/build/main/Release/CMakeFiles/CMakeOutput.log".
make: *** [cmake_check_build_system] Error 1
+ set +x
...

linking to external libraries is hugely important. i cannot use AlloLib for my project until this issue is resolved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.