Question: What ?

Asked By
justgook
Asked At
2018-01-25 21:02:32

Found 15 possible answers.

User Answered At Possible Answer
unsoundscapes 2018-01-25 21:03:06 the red part is a div, and blue part is rendered with webgl
justgook 2018-01-25 21:03:21 ow it can be done with css make some webpages, that will renders cubes? what point of doing somethink like that? kind of billboard
passiomatic 2018-01-25 21:12:36 It may be useful to render text into a WebGL scene.
unsoundscapes 2018-01-25 21:13:56 this cube can be anything I guess you could also add clickable areas instead of ray tracing it’s just a proof of concept
justgook 2018-01-25 21:30:17 but in real - there is just DIV - that fly in front of some WebGL… Other noob question - is there way to update some data inside shaders, and save that data for calculating next frame ? Ow - one - simpler is deprecated Why there is two packages ? http://package.elm-lang.org/packages/elm-community/webgl/latest Vs http://package.elm-lang.org/packages/elm-community/elm-webgl/3.0.4/WebGL https://github.com/w0rm/elm-webgl-playground/blob/master/CSS3d.elm - that part but if u use simethink like that.. it would be nice to look how it can sync with 3d world positions / rotatiotins.. position.. main problem of most part in GUI dev is make that party sync with game maybe good point For game dev I see usage of that.. You can create HUD / GUI with HTML..
huscar 2018-01-26 10:11:57 Don't think so in Elm, in js you could simply not rebind uniforms (IIRC) but Elm expects you to have the entire shader and uniforms/attributes in one Entity. That said I think the Elm way of doing this is better anyway: it is the most common use-case and a very useful abstraction. Speed improvement is probably not noticeable at all and for large datatypes Elm *could* optimize the binding by checking reference equality (same as DOM generation)
justgook 2018-01-26 10:21:49 so - main question is it possible at all in WebGL - to udate some data inside shader, and pass it to next rendering cycle (frame)?
unsoundscapes 2018-01-26 10:27:49 no, it is not rendering to a texture is a planned feature
huscar 2018-01-26 10:36:05 Barring render to texture, iirc features for computation in shaders are generally not (well?) supported in WebGL compared to say OpenGL 4, even in JS.
unsoundscapes 2018-01-26 10:40:32 Yeah, I think the only way to pass smth in webgl is by rendering to a texture and then using this texture as a uniform
passiomatic 2018-01-26 10:41:56 Speaking of that, do you have a vague idea of the API for this? I read Evan gave a green light recentky
unsoundscapes 2018-01-26 10:49:45 So the main problem is that it is impossible to render anything without having an access to gl context. 3. Keep a texture as a list of entities and lazily evaluate it when the main scene is rendered (prototyped here https://github.com/elm-community/webgl/tree/render-to-texture ) 2. A custom DOM event that is triggered from toHtml and contains a texture 1. A task/command that gets id of the canvas element (as proposed by @shamansir https://github.com/elm-community/webgl/pull/45 ) Which basically limits to three options to get a texture:
passiomatic 2018-01-26 10:55:13 I see. My understanding of WebGL is limited so I don’t see a winning solution
unsoundscapes 2018-01-26 10:55:20 Each has it's benefits and tradeoffs. I guess it would be better to do a writeup on each and present it to Evan
passiomatic 2018-01-26 11:01:46 From the point of view of the shaders, it should not make any different, right? Instead of write to a buffer which eventually goes to the screen it you render to a texture, correct?

Related Questions