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

Updated Interactive rendering demo #36

Open
dallinbeutler opened this issue Jul 29, 2019 · 9 comments
Open

Updated Interactive rendering demo #36

dallinbeutler opened this issue Jul 29, 2019 · 9 comments

Comments

@dallinbeutler
Copy link
Contributor

As an outsider, I'm trying to replicate what was seen in the demo on youtube

LiveDemo.fsx looked like the closest option, but upon inspecting its "loadReferences.fsx" file it looks to be somewhat out of date. (Fshade.dll renamed to fshade.core.dll, #11 implies that that nanovg shouldn't be referenced, etc.).
I guess as a beginner here, I ultimately want to know what the proper steps would be for taking the standard template, and running an interactive rendering session on top of it?
thanks

@haraldsteinlechner
Copy link
Member

hi. thanks for checking out! the file you mentioned is the right if i remember correctly. i will look into this...

bests

@haraldsteinlechner
Copy link
Member

i just create a new f# interactive setup. due to native dependencies and some other annoyances it is not totally straightforward to get fsharp interactive running with rendering windows etc.

my demo is given in the walkthrough repository which shows is a collection of technical background information.
the setup is here: https://github.com/aardvark-platform/walkthrough/tree/master/src/InteractiveNet471

i made a little video showing how it works: https://youtu.be/899Ld6JZsBA

the story however is not over. there is stuff to do:

so far the progress, bests harald

@dallinbeutler
Copy link
Contributor Author

Thanks for the update! Those are valid concerns and duly noted. Looks straight forward enough. I'll test this as soon as I have time and get back to you! Not sure how much I could help with issues yet, but I'm willing to dive in.

@dallinbeutler
Copy link
Contributor Author

dallinbeutler commented Aug 1, 2019

Works on my machine! nice! And yeah, I see what you mean with the boilerplate.
And I take it transact is the only way to force an update to reflect changes in the dependency graph?
not an issue, just making sure I understand the flow of things.

On a semi-related note, it seems that everything is there to make a Safe style template or like this fable electron with a hot module replacement workflow.

I'll play around interactive and with some ideas, and let you guys know if I come up with anything useful.

@haraldsteinlechner
Copy link
Member

haraldsteinlechner commented Aug 1, 2019

i just moved the boilerplate code to aardvark.rendering.

the file now looks like this

  • yes, in plain aardvark.rendering, we use transact to feed changes into the dependency graph. in aardvark.media we layered an ELM implementation on top, which internally performs diffing and feeds changes into the system using transact
  • in an early, now deprecated experiment we tried hmr stuff using f# compiler service i think. it is super outdated from a technological perspective. the code is fablish. fablish is now deprecated in favor of aardvark.media
  • if you have cool ideas regarding safe or hmr stuff we could definitly check out some stuff based on your ideas.
  • i renewed the issue regarding netcore support Application.Slim.* packages only provide blocking Run() methods #37
  • what is missing now is a kind of docu on how to setup fsi with aardvark. i'm working on it...

looking forward to more open source activity in the ecosystem :)

@dallinbeutler
Copy link
Contributor Author

  • So I don't need to call transact in the .media context? .media sounds almost identical to Fable.React in both goal and function. Is there any significant differences between them? I assume .Media exists to avoid Node.js and npm depencies? And I'm assuming more seamless interop between .Media and .Rendering?
  • so does hmr work in .Media? or your saying that functionality got deprecated as you moved from fablish?
  • I'll definitely keep you posted! Interactive works pretty darn well for now. hmr is really to avoid the last stretch of highlighting + alt entering. which hooking up an fsi session and automatically sending file changes to it was relatively easy, last time I tried it.
  • awesome, awesome. It sounds like @gsomix might look at it?
  • yeah, I think that's one of the first thing people would want to try, since it's so easy to tweak small things and see what happens. like a sandbox. Let me know if you want help!

Thanks again for being so helpful and welcoming! The more time I've spent with it the more excited I get 😄

@krauthaufen
Copy link
Member

So I don't need to call transact in the .media context? .media sounds almost identical to Fable.React in both goal and function.

media (we know it's a quite bad name) was invented to get server-side rendering of 3d content into html apps and since 3d rendering tends to require huge scenegraphs we were not quite happy with the ELM/Fable-approach recreating the entire SceneGraph/DOM on every change of the model. Therefore we explored the path of differentiating the Model instead of the Scene/DOM and integrating it with our incremental system. Since programmers then need to use the incrementalized model in the view function (composed of IMods, alists, asets and so on) we have a special msbuild-plugin called Aardvark.Compiler.DomainTypes which generates the code for the incremental model.

So to answer your question, media-apps basically look just like fable/elm apps and App.start takes care of submitting changes to the system (via transact).
However there are two main differences between fable/elm and media:

  • media works entirely server-side (we're planning to make it work client-side too)
  • the view function in media gets the incrementalized model instead of the immutable model and is therefore executed exaclty once.

The whole concept has been explained quite well by @ThomasOrtner here, here and here

so does hmr work in .Media? or your saying that functionality got deprecated as you moved from fablish?

We sadly never made that work, but it would obviously be great to see that. The hard part here might be to also integrate the Domain-Type-Compiler into the HMR system. (since it needs to regenerate files on model-changes)

@haraldsteinlechner
Copy link
Member

@dallinbeutler
Copy link
Contributor Author

dallinbeutler commented Aug 6, 2019

looks good! I tested on two different computers with VS, and the only issue was forgetting to set FSI to 64 bit on the other one.
I'll going to look through domaintcc and see if I can help with that

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

No branches or pull requests

3 participants