Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake changes for Visualiser #219

Merged
merged 14 commits into from
Apr 22, 2020
Merged

CMake changes for Visualiser #219

merged 14 commits into from
Apr 22, 2020

Conversation

Robadob
Copy link
Member

@Robadob Robadob commented Mar 19, 2020

Closes #69

These changes enable VISUALISATION flag to be set at CMake time.

This flag pulls in the visualiser repo and marks it as a dependency of FGPU2, configures include dirs and copies SDL.dll on compilation success.

Have tested it with the root CMake project, and added it/tested with example ones too.

This should probably remain draft until the visualiser is ready, and an example has an optional vis.

Two possible remaining tasks:

  • Visualiser depends on GLM, FGPU2 will depend on GLM, this could mean the repo is cloned twice independently (and due to size its a fairly slow clone).
  • Due to the nature of CMake options, if VISUALISATION is set ON all examples/tests will be setup to have visualiser enabled, even if they don't require it. Probably not a big deal but notable.

@Robadob
Copy link
Member Author

Robadob commented Mar 30, 2020

Now have it working with a simple fixed example, I haven't commit these changes due to the large amount of dependency hell I need to cleanup (to save polluting the vis repo).

Brief video demo here: https://youtu.be/-W7fkSgg3IM (poor quality because youtube has downscaled from 1440p to 1080p)

Jobs Todo:

  • Removal of non core C/C++ from interface (this will reduce the need to share includes, it's kind of recommended behaviour for libraries)

Mostly the dependency stuff tied to CMake I want to fix before putting these changes on git.

@ptheywood
Copy link
Member

I'm happy to test / fix this on linux once it's worth doing. The SDL installation wiki suggests using the distribution provided copy rather than building your own copy. This should just be looking for SDL2, and if not found but requested building it at that point in time.

As an aside we might want to think about offline builds. I.e. what if you have a local copy of gtest but due to lack of internet the download fails? This is probably worthy of an isse?

@Robadob
Copy link
Member Author

Robadob commented Mar 30, 2020

I'm happy to test / fix this on linux once it's worth doing.

I'd wait until the todo list is completed, some of that cleanup should simplify any issues you'll need to address.

This should just be looking for SDL2, and if not found but requested building it at that point in time.

SDL already works like that, I haven't looked into freetype or glew yet.

As an aside we might want to think about offline builds. ...

That's not too impactful, I've already done that for the FGPU2_vis include, so I can dev it not in a weird nested folder.

@Robadob
Copy link
Member Author

Robadob commented Apr 2, 2020

It should now be possible to build the visualisation on windows via the main FGPU2 cmake. Running might be a challenge due to the resource paths for shader/model, which are currently hardcoded to paths on my machine.

@Robadob
Copy link
Member Author

Robadob commented Apr 2, 2020

Should start build a list of configuration options to add support for: (feel free to edit this comment with suggestions)

P.S. Re the Agent/AgentState, i'm a fan of agent states reverting to agent defaults for any values not set through the state, even if the agent setting is updated after the agent state is created. However this is programatically icky to implement (e.g. an additional bool flag per var, as far as i can tell).

Model/Window Level:

  • Window title
  • Window dimensions
  • Clear color
  • Display FPS (Render FPS is not linked to model speed)
  • Text color (don't want it to clash with clear color)
  • Environment scale
    • Camera start pos
    • Camera target pos
    • Camera move speed
    • Near/far clip
    • It would make sense to have a debug output to screen to help in deciding these values

Agent/AgentState Level:

Misc:

@Robadob
Copy link
Member Author

Robadob commented Apr 7, 2020

Started working on agent customisation, model path and scale (1d or 3d) can be chosen. Need to also allow this to be customised on per agent-state basis.

Scale isn't really worth using until env scale options are in place (shader is still hardcoded to multiply agent locs by some constant atm).

@Robadob Robadob marked this pull request as ready for review April 8, 2020 16:08
VISUALISATION_ROOT cmake var to skip pulling in vis repo
Initial vis config (model path/scale, window size/title)
Remove primage visualiser support from circles model
@Robadob
Copy link
Member Author

Robadob commented Apr 8, 2020

From today's meeting Paul wants a minimal functional version, so that I can move onto submodels.

I think the key things remaining for this are:

  • Environment scale
  • Replace use of assert/fprintf
  • Display step numberf on HUD

Should all be quite trivial to complete
Probably also the Linux/threading bug Pete is chasing (single iteration deallocates agents before they're copied to buffer).

@Robadob
Copy link
Member Author

Robadob commented Apr 17, 2020

I'm happy for this to be merged now. Maybe a case for squashing the final few commits. and updating messages on others to clarify visualisation.

Note: Need to update CMakeLists to point to visualisation repo master (once Pete has given Linux a check and the branch has been merged. (Done by Pete in final commit)

@mondus mondus merged commit b641181 into master Apr 22, 2020
@mondus mondus deleted the visualisation branch April 22, 2020 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualisation
3 participants