You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2012/01/24 18:14:09 UTC

Long-Term experiments for Pivot: WebGL

Hi all,
a crazy idea come to my mind from what I start to read, it seems that
WebGL will be more and more present in our future ...ok, now it's too
early probably and works good in Google Chrome (and sometimes in
Firefox), and a mandatory requirement is to have a good Graphics Board
(many times there is a better board in mobile phones that in many
corporate PCs).

But the idea to have GPU-accelerated GUI and effects looks very promising to me.
I know that there are already some Javascript libraries, but why not ?


It's not clear to me if HTML5 Canvas should be enough, but from what I
read probably not ... but this not the core of the question, if we
could have 3D graphics with realtime effects, compositing, etc why not
think big ? 2D graphics could be rendered as textures, or simply used
as compositing planes/layers.
Assuming that it makes sense for the market of Pivot applications. But
for example I'm thinking on new ways to explore data in interactive
way, etc ... I come from a 3D Graphics background, so could be my
vision of things.

The hard part here could be to leave open a way for applications
developers to write their "visual" skin.


Someone has already started to playing with some of them ?


For a long-term perspective ... a Pivot backend for WebGL (for what is
possible, but I think could be a great thing for the future) ... what
do you think ? Note that in this way we could solve even the
portability on Mobile platforms, and even try to work outside the JVM.


But please no flame wars, just to know if there is some interes on
this ... and if yes I could open a shared project on apache-extras so
we can together start to work on it. Identifying what can be reused
from Pivot (maybe all the BXML Stuff and many other things).

Note: I'm inside the Pivot project since its beginning in Open Source,
so I'm not crazy to write/ask comments on this, I only think that
things are evolving, so sometimes an idea could be interesting to
explore in a long-term perspective ... at least to say "no, it doesn't
interest me".


Bye,
Sandro

Re: Long-Term experiments for Pivot: WebGL

Posted by Sandro Martini <sa...@gmail.com>.
Sorry, another link that could be interesting on this:

http://processingjs.org/articles/p5QuickStart.html#javatojavascript


Sandro

Re: Long-Term experiments for Pivot: WebGL

Posted by Sandro Martini <sa...@gmail.com>.
Sorry, another link that could be interesting on this:

http://processingjs.org/articles/p5QuickStart.html#javatojavascript


Sandro

Re: Long-Term experiments for Pivot: WebGL

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,
thanks for your comments.

> FYI - last I checked, Microsoft had not committed to this standard, though that may have changed.
Yes, don't have any news too ... there are some browser plugin to
support this in IE but of course is a different story than having it
supported natively.

For sure (Microsoft or not) all the Video Games market will have a
great role to push WebGL, so let's see ... and in any case there will
always be the need to build user interfaces, even in that case.


>> It's not clear to me if HTML5 Canvas should be enough
>
> IMO, the biggest limitation with canvas is it's lack of font metric info. Otherwise, it's pretty capable for 2D graphics.
I have read some article and doesn't seem it's a good option for
scalable user interfaces, but haven't tried so I can't say so much ...
and having "only" a better graphics (and effects, animations, etc)
than usual HTML5 components doesn't give me the impression that worth
the case to support it (because using many modern Javascript libraries
and CSS3 probably we are near to the same final result in some cases),
but it's just an impression. And our target are not Games :-) .

> Also, I believe that in IE, canvas support is implemented using Direct2D, which is a hardware-accelerated 2D drawing API. I think canvas drawing is also accelerated on the Mac, but I'm not 100% sure.
IE 10 should heve a great (hardware-accelerated) Canvas, but should be
available only on newest platforms (Windows 8, and maybe Windows 7,
both even on Mobile phones, and probably not other previous).
But using all modern GPU benefits are real time effects, shaders, etc,
and 2D is a particular case in a 3D world.

I have seen that there are already some Javascript library that wraps
Canvas (2D) and WebGL (3D), and this could be a good option, but of
course try to support both it's an hard way.
Note that WebGL output is rendered inside canvas elements.

A small tutorial here:
http://www.khronos.org/webgl/wiki/Tutorial


For Pivot 2.1 we already have some plan to try to isolate (and
standardize) Java AWT / Java2D usage, and provide the current
implementation (in a dedicated module) an implementation as default
provider.
Maybe we could try to look at what other parts of Pivot could be
generalized (like BXML processing, etc) ...


If someone has some idea/experiment it's welcome, even only for
discussion ... we have a lot of time for thinking on features like
these before a real usage I think.

Bye,
Sandro

Re: Long-Term experiments for Pivot: WebGL

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,
thanks for your comments.

> FYI - last I checked, Microsoft had not committed to this standard, though that may have changed.
Yes, don't have any news too ... there are some browser plugin to
support this in IE but of course is a different story than having it
supported natively.

For sure (Microsoft or not) all the Video Games market will have a
great role to push WebGL, so let's see ... and in any case there will
always be the need to build user interfaces, even in that case.


>> It's not clear to me if HTML5 Canvas should be enough
>
> IMO, the biggest limitation with canvas is it's lack of font metric info. Otherwise, it's pretty capable for 2D graphics.
I have read some article and doesn't seem it's a good option for
scalable user interfaces, but haven't tried so I can't say so much ...
and having "only" a better graphics (and effects, animations, etc)
than usual HTML5 components doesn't give me the impression that worth
the case to support it (because using many modern Javascript libraries
and CSS3 probably we are near to the same final result in some cases),
but it's just an impression. And our target are not Games :-) .

> Also, I believe that in IE, canvas support is implemented using Direct2D, which is a hardware-accelerated 2D drawing API. I think canvas drawing is also accelerated on the Mac, but I'm not 100% sure.
IE 10 should heve a great (hardware-accelerated) Canvas, but should be
available only on newest platforms (Windows 8, and maybe Windows 7,
both even on Mobile phones, and probably not other previous).
But using all modern GPU benefits are real time effects, shaders, etc,
and 2D is a particular case in a 3D world.

I have seen that there are already some Javascript library that wraps
Canvas (2D) and WebGL (3D), and this could be a good option, but of
course try to support both it's an hard way.
Note that WebGL output is rendered inside canvas elements.

A small tutorial here:
http://www.khronos.org/webgl/wiki/Tutorial


For Pivot 2.1 we already have some plan to try to isolate (and
standardize) Java AWT / Java2D usage, and provide the current
implementation (in a dedicated module) an implementation as default
provider.
Maybe we could try to look at what other parts of Pivot could be
generalized (like BXML processing, etc) ...


If someone has some idea/experiment it's welcome, even only for
discussion ... we have a lot of time for thinking on features like
these before a real usage I think.

Bye,
Sandro

Re: Long-Term experiments for Pivot: WebGL

Posted by Greg Brown <gk...@verizon.net>.
> a crazy idea come to my mind from what I start to read, it seems that
> WebGL will be more and more present in our future …

FYI - last I checked, Microsoft had not committed to this standard, though that may have changed.

> It's not clear to me if HTML5 Canvas should be enough

IMO, the biggest limitation with canvas is it's lack of font metric info. Otherwise, it's pretty capable for 2D graphics. 

Also, I believe that in IE, canvas support is implemented using Direct2D, which is a hardware-accelerated 2D drawing API. I think canvas drawing is also accelerated on the Mac, but I'm not 100% sure.



Re: Long-Term experiments for Pivot: WebGL

Posted by Greg Brown <gk...@verizon.net>.
> a crazy idea come to my mind from what I start to read, it seems that
> WebGL will be more and more present in our future …

FYI - last I checked, Microsoft had not committed to this standard, though that may have changed.

> It's not clear to me if HTML5 Canvas should be enough

IMO, the biggest limitation with canvas is it's lack of font metric info. Otherwise, it's pretty capable for 2D graphics. 

Also, I believe that in IE, canvas support is implemented using Direct2D, which is a hardware-accelerated 2D drawing API. I think canvas drawing is also accelerated on the Mac, but I'm not 100% sure.