OGRE (Object-Oriented Graphics Rendering Engine) has been ported to NaCl

407 views
Skip to first unread message

Assaf Raman

unread,
Aug 22, 2011, 3:46:09 AM8/22/11
to Native-Client-Discuss
Hi,

My name is Assaf and I am one of OGRE core team members.

Last week I ported OGRE to NaCl.

You can see OGRE sample browser running in Chrome using NaCl on this
page: http://goo.gl/2BW4F

NaCl SDK team - feel free to add it to your gallery, but preferably
put it on your site, here is a zip file of the web site OGRE:
http://goo.gl/te4Sv

I think you can learn from my experience and adapt the tool I wrote to
convert existing Visual Studio solutions to compile for NaCl. Read the
full story here: http://goo.gl/Y03ka

NaCl is a very good idea, all of us in the OGRE community are behind
you in your effort.

The biggest restriction from really using NaCl is that there are so
many protective flags, only a very advanced user can start a 3D NaCl
application - so I don't really see anyone releasing something for the
mass markets that uses NaCl until this is changed.

Feel free to contact me or follow me on twitter (assaframan).

Regards,

Assaf Raman

Fernando Carvalho

unread,
Aug 22, 2011, 9:46:39 AM8/22/11
to native-cli...@googlegroups.com
That is very cool. I just tested it here on Ubuntu 64 bit and it works great.
Do you have any documentation about how to create those things?
I think that Google will soon resolve these issues about enabling flags. It is only a matter of time until the OpenGL api gets stable enough to be enabled by default.


--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.




--
Fernando

Assaf Raman

unread,
Aug 22, 2011, 10:44:09 AM8/22/11
to Native-Client-Discuss
Hi Fernando,

What do you mean by "those things"? The cases it doesn't run?

Regards,

Assaf

On Aug 22, 4:46 pm, Fernando Carvalho

Erik Kay

unread,
Aug 22, 2011, 11:51:05 AM8/22/11
to native-cli...@googlegroups.com
Thanks for the feedback Assaf.  Right now, the 3D API is in a state where only developers can use it.  This should change soon with Chrome 15.

Erik

 

Feel free to contact me or follow me on twitter (assaframan).

Regards,

Assaf Raman

Fernando Carvalho

unread,
Aug 22, 2011, 6:22:39 PM8/22/11
to Native-Client-Discuss
I'm sorry for that. What I wanna know is if you have any documentation
about how you created your OGRE demos. I wish to try creating some
stuff here by myself and see what I'm able to do.

On Aug 22, 12:51 pm, Erik Kay <erik...@google.com> wrote:

Assaf Raman

unread,
Aug 23, 2011, 2:24:06 AM8/23/11
to Native-Client-Discuss
All the documentation is here: http://goo.gl/Y03ka

On Aug 23, 1:22 am, Fernando Carvalho

Ivan Krasin

unread,
Aug 23, 2011, 3:07:41 AM8/23/11
to native-cli...@googlegroups.com
Assaf,

I've just skimmed over your awesome post. It seems that you have been
affected by a lot of NaCl bugs.


==================
A 32bit XP computer gets a blue screen every time you start the second sample.
A 32bit win7 computer doesn’t start the nexe with a "bad ELF file" message.
A 32bit OSX mac doesn't load the nexe without any reason or error.
The download sometimes doesn't work without any reason.
The progress callback from the nexe download only return in 0% and
100%, that is not so good when the nexe file size is 20MB. I think I
can workaround this by downloading the file in javascript – with
progress, then using it and it will be in the cache.
==================

I would really appreciate if you file issues here:
http://code.google.com/p/nativeclient/issues/list
Even if you would not be able to find time for that -- huge thanks! I
will try to reproduce at least some of these bugs.

Ivan Krasin

Assaf Raman

unread,
Aug 23, 2011, 9:34:37 AM8/23/11
to Native-Client-Discuss
Hi Ivan,

I opened up the issues like you requested:

Issue 2177 - A 32bit OSX mac doesn't load the nexe without any reason
or error.
Issue 2178 - The nexe load progress doesn't work - only shows the 0%
and 100% of the progress.
Issue 2179 - Using opengl in a NaCl nexe program can cause a windows
blue screen.
Issue 2180 - NaCl doesn't work on ubuntu-10.10 using Chrome.
Was not able to reproduce - A 32bit win7 computer doesn’t start nexe
programs with a "bad ELF file" message.
I download issue may be my fault (I need to rewrite some the download
code there to be nicer) - then I will open bugs if needed.

Feel free to contact me.

Regards,

Assaf

Erik Kay

unread,
Aug 23, 2011, 11:09:17 AM8/23/11
to native-cli...@googlegroups.com
Thanks for the bug reports!

Assaf Raman

unread,
Sep 15, 2011, 10:02:39 PM9/15/11
to Native-Client-Discuss
The OGRE NaCl sample is working once more, with faster loading (it is
on a site with more bandwidth), I also added a progress bar for the
loading and resource downloading.
Try it out here: http://goo.gl/RVl4h
> > >> about how you created yourOGREdemos. I wish to try creating some
> > >> stuff here by myself and see what I'm able to do.
>
> > >> On Aug 22, 12:51 pm, Erik Kay <erik...@google.com> wrote:
>
> > >> > On Mon, Aug 22, 2011 at 12:46 AM, Assaf Raman <assafra...@gmail.com> wrote:
> > >> > > Hi,
>
> > >> > > My name is Assaf and I am one ofOGREcore team members.
>
> > >> > > Last week I  portedOGREto NaCl.
>
> > >> > > You can seeOGREsample browser running in Chrome using NaCl on this
> > >> > > page:http://goo.gl/2BW4F
>
> > >> > > NaCl SDK team - feel free to add it to your gallery, but preferably
> > >> > > put it on your site, here is a zip file of the web siteOGRE:
> > >> > >http://goo.gl/te4Sv
>
> > >> > > I think you can learn from my experience and adapt the tool I wrote to
> > >> > > convert existing Visual Studio solutions to compile for NaCl. Read the
> > >> > > full story here:http://goo.gl/Y03ka
>
> > >> > > NaCl is a very good idea, all of us in theOGREcommunity are behind

Jeff Ward

unread,
Sep 15, 2011, 10:49:31 PM9/15/11
to native-cli...@googlegroups.com
Very cool Assaf!

Are you building the SDK on your own to get 3D to work?

--
Jeff

assaf raman

unread,
Sep 15, 2011, 11:02:13 PM9/15/11
to native-cli...@googlegroups.com
Well, I used an older version of Chrome dev channel, when I just updated to the latest version - 3d stopped to work. I opened up an issue for the problem: http://code.google.com/p/nativeclient/issues/detail?id=2258#c0

I don't build the SDK on my own, I download it from here: http://build.chromium.org/f/client/nacl_archive/sdk/latest/

Ivan Krasin

unread,
Sep 15, 2011, 11:05:47 PM9/15/11
to native-cli...@googlegroups.com
Assaf,

I get a segfault in your nacl module.

15.0.865.0 dev, Linux x86-64

Chrome logs:

krasin@krasin7:/tmp/chrome-linux$ NACL_ENABLE_PPAPI_DEV=1
google-chrome --enable-accelerated-plugins --enable-nacl
--ignore-gpu-blacklist
[12,3988174592:20:02:39.130949] Entered NaClMakeDispatchThunk
[12,3988174592:20:02:39.131340] NaCl_page_alloc_randomized: 0x4bed6d1b
[12,3988174592:20:02:39.131473] NaCl_page_alloc_randomized: hint 0x4bed6d1b0000
[12,3988174592:20:02:39.131606] NaClMakeDispatchThunk: got addr 0x4bed6d1b0000
[7,3989157632:20:02:39.219312]
PluginReverseInterface::StartupInitializationComplete
[7,3989157632:20:02:39.219544]
PluginReverseInterface::StartupInitializationComplete: invoking CB
[12,3987949312:20:02:46.736487] munmap: rounded length to 0x25d0000
[12,3987949312:20:02:46.861078] munmap: rounded length to 0x110000
[SRPC:HOST:7,3988867488:20:02:46.895351]
NaClSrpcRpcWait(channel=0x7f48f27cedc0): EOF is received instead of
response. Probably, the other side (usually, nacl module or browser
plugin) crashed.

HTML output:

NaCl exe loading started
load
NaCl exe loading ended
lastError: <none>
downloading resource zip file started: Popular.zip
downloading resource zip file started: Essential.zip
If it works you should see ogre sample browser under this text. (wait
20 min for it...)

JavaScript console:

NativeClient: Log message that should show up on the JavaScript console
tumbler.js:91loadResourcesFromUrl:resourcesUrls.txt
tumbler.js:91loadResourcesFromUrl
tumbler.js:91mFileSystem.Open
tumbler.js:91download
tumbler.js:91resourcesUrls.txt
tumbler.js:91onOpen
tumbler.js:91readBody
tumbler.js:91onDownloadedFile
tumbler.js:91downloading resource zip file finished: resourcesUrls.txt
tumbler.js:91mUrlLoader.GetResponseInfo()
tumbler.js:91urlFile
tumbler.js:91onOpenFile
tumbler.js:91onGetFileSize
tumbler.js:9126
tumbler.js:91onGetFileRead
tumbler.js:91onDownloadConfig
tumbler.js:91downloadNextResourceZip
tumbler.js:91getting resource zip file(from url or local store): Popular.zip
tumbler.js:91download
tumbler.js:91Popular.zip
tumbler.js:91onTryToOpenLocalFile
tumbler.js:91file not found - will download.
tumbler.js:91downloading resource zip file started: Popular.zip
tumbler.js:91onOpen
tumbler.js:91readBody
tumbler.js:91onDownloadedFile
tumbler.js:91downloading resource zip file finished: Popular.zip
tumbler.js:91mUrlLoader.GetResponseInfo()
tumbler.js:91urlFile
tumbler.js:91onOpenFile
tumbler.js:91onGetFileSize
tumbler.js:9139620975
tumbler.js:91onGetFileRead
tumbler.js:91onOpenStoreFileForSave
tumbler.js:91onOpenStoreFileForSave:::::::IsError
tumbler.js:91onWriteStoreFile
tumbler.js:91onWriteStoreFile:::::::IsError
tumbler.js:91onResourceZipDownloaded
tumbler.js:91downloadNextResourceZip
tumbler.js:91getting resource zip file(from url or local store): Essential.zip
tumbler.js:91download
tumbler.js:91Essential.zip
tumbler.js:91onTryToOpenLocalFile
tumbler.js:91file not found - will download.
tumbler.js:91downloading resource zip file started: Essential.zip
tumbler.js:91onOpen
tumbler.js:91readBody
tumbler.js:91onDownloadedFile
tumbler.js:91downloading resource zip file finished: Essential.zip
tumbler.js:91mUrlLoader.GetResponseInfo()
tumbler.js:91urlFile
tumbler.js:91onOpenFile
tumbler.js:91onGetFileSize
tumbler.js:911090499
tumbler.js:91onGetFileRead
tumbler.js:91onOpenStoreFileForSave
tumbler.js:91onOpenStoreFileForSave:::::::IsError
tumbler.js:91onWriteStoreFile
tumbler.js:91onWriteStoreFile:::::::IsError
tumbler.js:91onResourceZipDownloaded
tumbler.js:91downloadNextResourceZip
tumbler.js:59now initOgre
tumbler.js:91initOgre:800:600
tumbler.js:91initOgre
tumbler.js:91800
tumbler.js:91600
tumbler.js:91Creating resource group General
tumbler.js:91Creating resource group Internal
tumbler.js:91Creating resource group Autodetect
tumbler.js:91SceneManagerFactory for type 'DefaultSceneManager' registered.
tumbler.js:91Registering ResourceManager for type Material
tumbler.js:91Registering ResourceManager for type Mesh
tumbler.js:91Registering ResourceManager for type Skeleton
tumbler.js:91MovableObjectFactory for type 'ParticleSystem' registered.
tumbler.js:91OverlayElementFactory for type Panel registered.
tumbler.js:91OverlayElementFactory for type BorderPanel registered.
tumbler.js:91OverlayElementFactory for type TextArea registered.
tumbler.js:91Registering ResourceManager for type Font
tumbler.js:91ArchiveFactory for archive type FileSystem registered.
tumbler.js:91ArchiveFactory for archive type Zip registered.
tumbler.js:91ArchiveFactory for archive type EmbeddedZip registered.
tumbler.js:91DDS codec registering
tumbler.js:91FreeImage version: 3.14.1
tumbler.js:91This program uses FreeImage, a free, open source image
library supporting all common bitmap formats. See
http://freeimage.sourceforge.net for details
tumbler.js:91Supported formats:
bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
tumbler.js:91PVRTC codec registering
tumbler.js:91Registering ResourceManager for type HighLevelGpuProgram
tumbler.js:91Registering ResourceManager for type Compositor
tumbler.js:91MovableObjectFactory for type 'Entity' registered.
tumbler.js:91MovableObjectFactory for type 'Light' registered.
tumbler.js:91MovableObjectFactory for type 'BillboardSet' registered.
tumbler.js:91MovableObjectFactory for type 'ManualObject' registered.
tumbler.js:91MovableObjectFactory for type 'BillboardChain' registered.
tumbler.js:91MovableObjectFactory for type 'RibbonTrail' registered.
tumbler.js:91*-*-* OGRE Initialising
tumbler.js:91*-*-* Version 1.8.0unstable (Byatis)
tumbler.js:91Installing plugin: OpenGL ES 2.0 RenderSystem
tumbler.js:91OpenGL ES 2.x Rendering Subsystem created.
tumbler.js:91 GLSupport addConfig called
tumbler.js:91Plugin successfully installed
tumbler.js:91Installing plugin: Octree Scene Manager
tumbler.js:91Plugin successfully installed
tumbler.js:91Installing plugin: ParticleFX
tumbler.js:91Particle Emitter Type 'Point' registered
tumbler.js:91Particle Emitter Type 'Box' registered
tumbler.js:91Particle Emitter Type 'Ellipsoid' registered
tumbler.js:91Particle Emitter Type 'Cylinder' registered
tumbler.js:91Particle Emitter Type 'Ring' registered
tumbler.js:91Particle Emitter Type 'HollowEllipsoid' registered
tumbler.js:91Particle Affector Type 'LinearForce' registered
tumbler.js:91Particle Affector Type 'ColourFader' registered
tumbler.js:91Particle Affector Type 'ColourFader2' registered
tumbler.js:91Particle Affector Type 'ColourImage' registered
tumbler.js:91Particle Affector Type 'ColourInterpolator' registered
tumbler.js:91Particle Affector Type 'Scaler' registered
tumbler.js:91Particle Affector Type 'Rotator' registered
tumbler.js:91Particle Affector Type 'DirectionRandomiser' registered
tumbler.js:91Particle Affector Type 'DeflectorPlane' registered
tumbler.js:91Plugin successfully installed
tumbler.js:91Installing plugin: BSP Scene Manager
tumbler.js:91Plugin successfully installed
tumbler.js:91CPU Identifier & Features
tumbler.js:91-------------------------
tumbler.js:91 * CPU ID: X86
tumbler.js:91-------------------------
tumbler.js:91 GLSupport start called
tumbler.js:91 GLSupport createWindow called
tumbler.js:91GLES2RenderSystem::_createRenderWindow "OGRE Sample
Browser Window", 800x600 windowed miscParams: pp::Instance=271665904
tumbler.js:91 GLSupport newWindow called
tumbler.js:91 create called
tumbler.js:91 initNativeCreatedWindow called
tumbler.js:91 getting pp::Instance - if stopped here - it means the
parameter is null!
tumbler.js:91 got the pp::Instance.
tumbler.js:91 initNativeCreatedWindow ended
tumbler.js:91 create context started

Any ideas what's wrong?

Assaf Raman

unread,
Sep 16, 2011, 9:11:38 AM9/16/11
to Native-Client-Discuss
Seems to be an issue on the Chrome side. 3d in NaCl seems to stopped
working altogether with the latest version of Chrome 15.

On Sep 16, 6:05 am, Ivan Krasin <imkra...@gmail.com> wrote:
> Assaf,
>
> library supporting all common bitmap formats. Seehttp://freeimage.sourceforge.netfor details
> > On Fri, Sep 16, 2011 at 5:49 AM, Jeff Ward <j...@fuzzybinary.com> wrote:
>
> >> Very cool Assaf!
> >> Are you building the SDK on your own to get 3D to work?
> >> --
> >> Jeff
>
> >> On Thu, Sep 15, 2011 at 10:02 PM, Assaf Raman <assafra...@gmail.com>
> ...
>
> read more »

Erwin Coumans

unread,
Sep 16, 2011, 12:03:13 PM9/16/11
to Native-Client-Discuss

This Ogre port is very cool.

The download bar seems to work well, is the latest version of your
work in some Ogre repository? If so, can you provide a URL with the
downloading bits?

Native Client SDK v0.5 works well with Chromium revision 96198 and
97282 , http://commondatastorage.googleapis.com/chromium-browser-continuous/index.html,
The Tumbler example as described here:
http://www.chromium.org/nativeclient/how-tos/guide-to-experimental-3d-support
works well, using the old graphics interfaces of NaCL SDK 0.5.

Are you using the newer pp:Graphics3D_Dev or pp:Graphics3D interfaces?
It seems they are not out of development yet.
It would be great to have a working Chromium revision number that
works with a specific NaCL nightly build (from
http://build.chromium.org/f/client/nacl_archive/sdk )

Even better would be if the NaCL client SDK ships with a working
Chromium revision.
Thanks,
Erwin






Thanks!
Erwin
> ...
>
> read more »

Assaf Raman

unread,
Sep 17, 2011, 4:47:41 PM9/17/11
to Native-Client-Discuss
Hן Erwin,

I delayed my answer because I was hoping for someone from Google to
give the reason why 3d is broken in the latest version of Chrome.

All of my OGRE work is considered experimental and my goal is to help
Google to improve this part of NaCl - so we can have c++ 3d games that
runs inside the browser safely.

Google keeps updating NaCl's pepper 3d API, so I have to update my
OGRE port every now and then. I try to keep with the NaCl SDK nightly
build by downloading it, compiling OGRE and its discrepancies with it,
then fixing issues if they exist.

Most of the time NaCl SDK nightly build can render 3d with Chrome
nightly build.

The first thing I do every time before compiling OGRE is to test that
the tumbler example works in the nightly Chrome - if it doesn't - I
open an issue for the NaCl team and wait for them to fix it.

As for this post date - 3D is broken in Chrome and I am still waiting
for the latest issue to be resolved.

BTW: I wait for the 3D to be resolved so I can open up a issue for a
more impotent bug - I found how to recreate the case where URLLoader
corrupts the downloaded file - so Google people fix 3D so I can open
that issue up...

Regarding where you can get my latest OGRE code of the NaCl port -
well - commit it directly to the main OGRE repository so you can just
get it from there.

Here are some links that are related to what I wrote above:
1. NaCl SDK nightly build: http://build.chromium.org/f/client/nacl_archive/sdk/latest/
2. Chrome nightly build: http://build.chromium.org/f/chromium/snapshots/
3. OGRE code: https://bitbucket.org/sinbad/ogre/
4. OGRE forum thread about NaCl port: http://www.ogre3d.org/forums/viewtopic.php?f=4&t=66394
5. My tool to convert visual studio solution to NaCl:
https://bitbucket.org/assaframan/vstonaclconvert/
6. The issue I opened for the current NaCl 3D problem:
http://code.google.com/p/nativeclient/issues/detail?id=2258

Hope this helps.

Regards,

Assaf


On Sep 16, 7:03 pm, Erwin Coumans <erwin.coum...@gmail.com> wrote:
> This Ogre port is very cool.
>
> The download bar seems to work well, is the latest version of your
> work in some Ogre repository? If so, can you provide a URL with the
> downloading bits?
>
> Native Client SDK v0.5 works well with Chromium revision 96198 and
> 97282 ,http://commondatastorage.googleapis.com/chromium-browser-continuous/i...,
> The Tumbler example as described here:http://www.chromium.org/nativeclient/how-tos/guide-to-experimental-3d...
> ...
>
> read more »

assaf raman

unread,
Sep 20, 2011, 3:16:54 AM9/20/11
to Native-Client-Discuss
OGRE NaCl demo works once more, try it out here: http://goo.gl/RVl4h
The issue I had was resolved with today's NaCl SDK nightly build.
> ...
>
> read more »

Fernando Carvalho

unread,
Sep 20, 2011, 9:23:46 AM9/20/11
to native-cli...@googlegroups.com
Nice work.
I don't think if it is worthwhile to talk about this at this stage, but I had some performance issues here and a hang out. I made a video of my experience in the attachment.
The system that I used was an Intel i7-2600 @ 3.4GHz with an Nvidia GeForce GTX 560 Ti (Driver version 270.41.06) on Ubuntu Linux 11.04 (64-bit) and Google Chrome 15.0.874.15 dev.

> ...
>
> read more »

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.




--
Fernando
ogre_nacl.webm

assaf raman

unread,
Sep 20, 2011, 9:42:29 AM9/20/11
to native-cli...@googlegroups.com
Thanks.
Regarding the performance issues - I don't have then on my win7 64bit computers.
It must be a Linux issue.
Google guys - can you test this out on Ubuntu?

assaf raman

unread,
Sep 23, 2011, 8:55:14 AM9/23/11
to native-cli...@googlegroups.com
FYI: This is the issue I hear most often from people that test out the OGRE NaCl demo - "Issue 2285: PP_INPUTEVENT_TYPE_MOUSEMOVE event doesn't happen for each windows mouse move"

assaf raman

unread,
Sep 23, 2011, 8:56:24 AM9/23/11
to native-cli...@googlegroups.com

assaf raman

unread,
Sep 23, 2011, 6:24:05 PM9/23/11
to Native-Client-Discuss
OK, I created a simple mouse move test, see it here: http://goo.gl/Aluo7
Seems that in the simple mouse move test - there is no issue.
I guess the issue is on the OGRE code side.
If you want my mouse move test code, get it from here: http://goo.gl/KDxj2

On Sep 23, 3:56 pm, assaf raman <assafra...@gmail.com> wrote:
> FYI: This is the issue I hear most often from people that test out the OGRE
> NaCl demo - "Issue 2285 <goog_731737038>: PP_INPUTEVENT_TYPE_MOUSEMOVE event
> doesn't happen for each windows mouse move"<http://code.google.com/p/nativeclient/issues/detail?id=2285>

Ivan Krasin

unread,
Sep 23, 2011, 6:29:56 PM9/23/11
to native-cli...@googlegroups.com
On Fri, Sep 23, 2011 at 3:24 PM, assaf raman <assaf...@gmail.com> wrote:
> OK, I created a simple mouse move test, see it here: http://goo.gl/Aluo7
> Seems that in the simple mouse move test - there is no issue.
just to confirm that this test works for me w/o any ussue (Ubuntu
x86-64, 15.0.874.21 dev)

> I guess the issue is on the OGRE code side.
> If you want my mouse move test code, get it from here: http://goo.gl/KDxj2
>
> On Sep 23, 3:56 pm, assaf raman <assafra...@gmail.com> wrote:
>> FYI: This is the issue I hear most often from people that test out the OGRE
>> NaCl demo - "Issue 2285 <goog_731737038>: PP_INPUTEVENT_TYPE_MOUSEMOVE event
>> doesn't happen for each windows mouse move"<http://code.google.com/p/nativeclient/issues/detail?id=2285>
>

assaf raman

unread,
Sep 23, 2011, 8:14:00 PM9/23/11
to native-cli...@googlegroups.com
I solved the mouse issue in the OGRE demo app, you can try the updated OGRE app for yourself here: http://goo.gl/2ztrR (I didn't find a way to update a Chrome Web Store app - so remove the OGRE app if you installed it in the past then re-install - to get the new version).
The way I solved it was by adding a mutex for the input (I lock the mutex in HandleInputEvent and in my render loop).
Creating the simple mouse move test actually helped me - I had a smiler issue there that was also solved by adding a mutex.

BTW: Fernando - can you re-check the performance issue you experienced on Ubuntu and see if it is now solved?

I can still see a small time lag for the OGRE cursor from the windows cursor, but I think it is due to vsync.
Is there a way to turn of virtual sync for 3d in NaCl?

Regards,

Assaf

JR

unread,
Sep 27, 2011, 4:12:38 PM9/27/11
to Native-Client-Discuss
FYI, The sample does not work for me. I am running Chrome 15 on Mac OS
X (Snow Leopard). I have enabled the native client and done everything
for it to work (I think).

I get a black screen that just stays there and does nothing even if it
is written SUCCESS up on top and everything. I've waitting 6 mins (but
never staying on that tab, however) and nothing has ever appeared.

It is a little weird, because when I use Chrome 14, at least I see
something (a still image of the sample).

assaf raman

unread,
Sep 27, 2011, 6:42:49 PM9/27/11
to native-cli...@googlegroups.com
Try Ogre demo at the app store with Chrome beta and get back to me if it doesn't work.


--

JR

unread,
Sep 27, 2011, 11:42:53 PM9/27/11
to Native-Client-Discuss
Still not working, same problem as before.

I opened up the javascript console and this is the last log :

OGRE EXCEPTION(7:InternalErrorException): Popular.zip - error whilst
opening archive: Unknown error. in ZipArchive::checkZzipError at C:/
hg_Code/ogre/ogre_nacl/src/OgreMain/src/OgreZip.cpp (line 297)

Everything before that seems to be okay.

On Sep 27, 6:42 pm, assaf raman <assafra...@gmail.com> wrote:
> Try Ogre demo at the app store <http://goo.gl/2ztrR> with Chrome beta and

assaf raman

unread,
Sep 28, 2011, 2:44:18 AM9/28/11
to native-cli...@googlegroups.com
This is an error I saw before. Clear the browser cache then retry.

JR

unread,
Sep 28, 2011, 11:40:59 PM9/28/11
to Native-Client-Discuss
I did what you asked me to to do (clear the browser cache).

Unfortunately, I am still getting the same error in the javasript
console.

assaf raman

unread,
Sep 29, 2011, 5:03:18 AM9/29/11
to native-cli...@googlegroups.com
This means the file gets corrupted somehow...
What exact OS version are you using? I want to open an issue for the Chrome team about it.

assaf raman

unread,
Sep 29, 2011, 5:29:23 PM9/29/11
to native-cli...@googlegroups.com
Hi,

I just fixed a very annoying bug that corrupted the OGRE demo colors.
Here is how the image should have looked (and the way it looks now):
good.jpg

And this is the way it looked before my fix:
bad.jpg

The fix was to change init attributes for pp::Graphics3D.

The source for my code was the tumbler example.
Original code:
    int32_t attribs[] = {
        PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8,
        PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24,
        PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8,
        PP_GRAPHICS3DATTRIB_SAMPLES, 0,
        PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0,
        PP_GRAPHICS3DATTRIB_WIDTH, size_.width(),
        PP_GRAPHICS3DATTRIB_HEIGHT, size_.height(),
        PP_GRAPHICS3DATTRIB_NONE
    };
    context_ = pp::Graphics3D(instance, pp::Graphics3D(), attribs);

The code that fixes the issue looks like this:
    int32_t attribs[] = {
        PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 0,
        PP_GRAPHICS3DATTRIB_BLUE_SIZE, 8,
        PP_GRAPHICS3DATTRIB_GREEN_SIZE, 8,
        PP_GRAPHICS3DATTRIB_RED_SIZE, 8,
        PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24,
        PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8,
        PP_GRAPHICS3DATTRIB_SAMPLES, 0,
        PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0,
        PP_GRAPHICS3DATTRIB_WIDTH, mWindow->getWidth(),
        PP_GRAPHICS3DATTRIB_HEIGHT, mWindow->getHeight(),
        PP_GRAPHICS3DATTRIB_NONE
    };

    context_= pp::Graphics3D(instance, pp::Graphics3D(), attribs);

The attributes don't really have good documentation, it took me a very long time to find this solution.
I recommend to the NaCl SDK dev team to modify the tumbler sample code to my code - it is the starting point for 3D engines porting work and this is an issue that is hard to find if you just copy the code from that sample and assume that it is good.

Regards,

Assaf 

Ivan Krasin

unread,
Sep 29, 2011, 5:43:57 PM9/29/11
to native-cli...@googlegroups.com
I have filed a bug in nativeclient-sdk issue tracker: http://code.google.com/p/nativeclient-sdk/issues/detail?id=136

Matthew Ball

unread,
Sep 29, 2011, 5:44:35 PM9/29/11
to native-cli...@googlegroups.com
Hi Assaf,

Would you mind opening an issue for this fix here:


Thanks!
-Matt

Nicholas Fullagar

unread,
Sep 29, 2011, 5:45:07 PM9/29/11
to native-cli...@googlegroups.com
Hi Assaf, sorry for your troubles.  I believe this is due to the compositing going on -- after you have finished rendering into the framebuffer, it is composited to the page using the alpha channel of the framebuffer.  Also, I believe it is assuming pre-multiplied alpha when performing this blend.  As you have found, one way around this is to configure the framebuffer to not have alpha, but this might be a limit if your engine needs to use framebuffer alpha for other special effects.

There are a couple of other solutions that might also work for you.  First solution: at the end of the frame, in NaCl code before calling SwapBuffer, set the pixel mask to only update the alpha channel, then clear the screen using a clear color of (1.0f, 1.0f, 1.0f, 1.0f) -- effectively setting alpha channel in the framebuffer to 1.0f while leaving the other color channels unchanged.  Second solution: you can modify your html to place a solid black rectangle behind the output of your NaCl / Graphics3D.  Since the blend is using pre-multiplied alpha, a black background should effectively make the source appear to be opaque, regardless of what is left in the framebuffer's alpha channel.  Either of these solutions should allow you to re-enable the alpha in the framebuffer.

assaf raman

unread,
Sep 29, 2011, 6:12:38 PM9/29/11
to native-cli...@googlegroups.com
Thanks for the answer, the pixel mask idea didn't work for me, but the black rectangle idea did.
I am not sure why the pixel mask didn't work. Doesn't really matter - I didn't like that solution.

Thanks for all your help.

Regards,

Assaf

Nicholas Fullagar

unread,
Sep 29, 2011, 7:25:56 PM9/29/11
to native-cli...@googlegroups.com
Hi Assaf, When using the channel mask to only update alpha, be sure to restore the mask to its previous state afterwards, or it will continue to affect the rendering of the following frame.  I agree the extra end-of-frame alpha channel clear isn't ideal, especially at higher resolutions on fill limited systems.  Another option, if doing full frame post-processing effects on the framebuffer: explicitly set the alpha to 1.0 for the output color in the post processing shaders, at the point you are done requiring alpha information in the framebuffer.

JR

unread,
Sep 29, 2011, 11:59:58 PM9/29/11
to Native-Client-Discuss
I am using Mac OS X 10.6.8.

On a side note, I built the latest version of Chromium form the Git
repo and the error doesn't occur. Unfortunately, the loading of
Essentials.zip hangs at 95% ( i gave it 10 minutes).
Reply all
Reply to author
Forward
0 new messages