Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] RE: Re: RE: Re: Speed problem and event handling


Chronological Thread 
  • From: "Bo Huang" < >
  • To: < >
  • Subject: [Manta] RE: Re: RE: Re: Speed problem and event handling
  • Date: Thu, 2 Oct 2008 17:07:58 -0400

I should be using the default Visual Studio compiler. If I switch my project to use Intel’s, I immediately get a “your license has expired” error upon compilation.

 

Yes, I have created OpenGL context to go along with a MFC window, thus my code has a WinMain() function. After each iteration of calculation is complete, I use the drawImage_pixels() in PureOpenGLDisplay, which then calls glDrawPixels() to draw the pixel buffer to the MFC window.

 

Manta definitely has many components; I will have to investigate your helpful suggestions. In a naïve view, I would assume implementing a threaded Windows application, with one thread handling user input, another handling rendering calculation, would reduce any serial bottleneck.

 

Thanks

 


From: Abe Stephens [mailto:
Sent: Thursday, October 02, 2008 4:03 PM
To:
Subject: [Manta] Re: RE: Re: Speed problem and event handling

 

 

On Oct 2, 2008, at 12:35 PM, Bo Huang wrote:



Hi Abe

 

Thanks for your insights. I was not aware other groups develop on Windows using Manta. Can you let me know so I can post more appropriately?

 

RayScale's website: http://rayscale.com/products indicates they were planning a Windows version before they were acquired.

 

 

Interestingly, the Intel compiler has expired on my machine and Manta still compiles and runs on Visual Studio, even with MANTA_SSE defined. Perhaps this is part of the problem?

 

 

Which compiler are you using to build Manta in visual studio? If multiple compilers are installed on the system it should be possible to choose a specific one... 



For Manta to work on Windows, I have added Windows messages processing code at the beginning of the for(;;) loop in internalRenderLoop(). Also, rather than using channel->display->displayImage(myContext, image), which renders to file by default, I created a PureOpenGLDisplay and utilized it to render to my MFC window. Admittedly, this is not a multi-threaded solution, though I would not expect such long delays whether if Windows events come in or not.

 

 

I would start debugging here. The Manta pipeline was carefully designed to eliminate a serial bottleneck during image display and other stages in the pipeline.  It should be possible to use Manta without modifying the engine by implementing new versions of the various interfaces.

 

There are two basic constructions for image display in Manta: The python viewer uses a thread-safe handoff to pass image buffers to a separate GUI thread which is responsible for all OpenGL commands.  The X11 programs like bin/manta use GLXImageDisplay to open separate connections to the server and send GL commands asynchronously to the GUI thread. It might be worth taking a look at how the PureOpenGLDisplay and SyncDisplay cooperate with the python DisplayThread class in wxManta.py.

 

Just to be clear, you're displaying the image in a GL context, inside an MFC window?



I do not allocate memory or use fancy storage in my material. Even if it were so, the pauses should appear on all configurations. But Debug does not exhibit the odd pause.

 

I will check if the transactions mechanism can be adopted.

 

It looks like EclipseCDT is not supported? I only remember mentioning of Xcode.

 

In the X11 display case, and to a certain extent in the python handoff display case, the image is displayed asynchronously to the GUI main loop, and often at a higher frequency. (The python handoff sends a callback to the GUI thread using wx.CallAfter(), which is executed as soon as the GUI finishes other work or immediately if the GUI is idle.)  I've noticed that the refresh rate of most GUIs fluctuates between 20 - 40 fps, which makes this asynchronous display very important. The downside of using something like wx.CallAfter is that if the renderer sends frames at a high enough rate (e.g. 500fps+), the GUI might not have a chance to process other events, leading to sluggish interaction.

 

 

 

Abe

 

 



 

Thanks

 


From: Abe Stephens [ ">mailto: ] 
Sent: Thursday, October 02, 2008 1:32 PM
To:  ">
Subject: [Manta] Re: Speed problem and event handling

 

Hi,

 

In general it will be difficult for people on the list to help with problems on Windows, just because no one here uses the platform. We also don't have access to the Intel compiler on the platform so it's difficult to even perform simple tests. Fortunately, other groups have developed products based on Manta in Visual Studio, so I'm pretty confident it should be possible.

 

Comments inline:

 

On Oct 2, 2008, at 10:45 AM, Bo Huang wrote:




1)

A problem of mine happens only for a processor intensive material I created.

 

The debug build in Visual Studio can run and animate in about one FPS consistently.

 

The minSizeRel build however is sporadic. Though faster speed wise, it may animate for two seconds, and then stops animating for five seconds, and repeat the process in a non-uniform fashion. During this pause it would be hard to drag the window, as if the Windows message loop is too busy to process mouse/keyboard data. Nonetheless, the default test scene, using the same set up, doesn’t exhibit this problem. Nor is my material using SSE optimizations yet.

 

Other configurations such as Release have never worked for me.

 

 

Are you using the python viewer or something else on windows? How does Release mode fail for the default scene?

 

Common performance pitfalls include things like allocating memory in a material shader or intersection routine, pushing items on to a stl container, or engaging in fine grained synchronization....

 

 

2)

To solve my problem, I wish to study how Manta handles rendering and keyboard/mouse events without bottlenecking one or the other. For example, are these tasks running on different threads? Are the keyboard/mouse events implemented in Python only?

 

 

Manta doesn't handle keyboard and mouse events (just like OpenGL doesn't handle keyboard and mouse events). The GUI library (raw X11, wxPython, Fox, etc.) can turn the event into a Manta transaction, say to update the camera. The GUI threads sends the transaction to the Manta engine using MantaInterface::addTransaction(). The callback contained within the transaction is executed before the next frame starts rendering. There are several different types of callbacks for small state changes, as well as parallel and serial state changes. See:

 




Though I have Manta working for Xcode, Xcode just refuses on break at many break points I have set up, which is echoed by other Xcode developers.

 

I wish to try EclipseCDT to see if debugging is better. I built Manta for EclipseCDT in CMake but do not see a project file I can open or import. Any guidance is appreciated.

 

 

I've always edited in emacs and used GDB on the command line. I think one or two people here use XCode to develop Manta- so they might be able to respond with advice.

 

Abe

 

 

 

 




Archive powered by MHonArc 2.6.16.

Top of page