Matlab select Graphics Hardware Acceleration - matlab

Somehow the OpenGL renderer of my matlab (2010b) does not work correctly, meaning, the plots are weird compositions of patches instead of the smooth surface I actually generate. When changing the renderer to zbuffer it works fine, however, I miss the possibility to use transparency. Moreover, I get the feeling that using opengl I would experience a performance boost, such that rotating and zooming and stuff would happen quicker.
I think the reason lies in my computer hardware. I got an intel HD graphics 4600 plus a NIVIDIA Quadro K610M/PCIe/SSE2. When typing "opengl info" , that second graphics card is listed. I already updated the driver but nothing changed.
Any Ideas what may be the problem?
Own solution idea: I would like to test the Intel HD graphics but didnt find a way to set it as the default accelerator when running Matlab. Do you know how to do that?

To switch the hardware used:- You can choose the hardware support in NVIDIA control panel, as shown below in the link.
Restart MATLAB and check using "opengl info" command. The 'Vendor' should have switched to the integrated processor type.

To get your smooth surfaces, you can run
opengl software
upon starting matlab. This doesn't solve your problem (I cannot run opengl hardware on my 64bit ubuntu HD4400 graphics), but might be a good workaround for the moment.
Also this way you know it is the opengl, not something else.
No idea about how to switch the chosen graphics card though, sorry.

Related

ocean simulation in Blender vs. Unity3D

I want to make an ocean simulation that is physically accurate.
The height and speed of the waves should be controlled by the keyboard at runtime.
In the ocean, there needs to be a boat that either moves along a path or is controlled by the keyboard.
So far I have made this simulation in Blender:
https://youtu.be/LJ6ncxv-k7w
The problems are as follows:
1. There is no collision with the ocean
2. There are no controllers for the boat's movement
3. I am able to control the waves, but not at runtime
I thought about switching to Unity because the user interface is obviously better, as it is a game engine. I do not want to use Blender's game engine as its future is uncertain at this point.
After reviewing the various Unity water simulation plugins, I came to these conclusions:
1. the buoyancy is great in most of them, such as in Aquas and SUIMONO
2. None of them seems to offer a physically realistic collision with the boat.
3. they do offer wave height control, but not much else as far as wave properties go.
4. Some of the plugins can be combined to get closer to satisfactory results.
My question is:
Should I go with Unity completely?
It seems perfect for my user control needs, but the plugins are lacking in the collision aspect. I came across this video, but no tutorial: https://www.youtube.com/watch?v=T0D_vrYm4FQ
Even if there was one, how could I combine it with the plugins?
Is there a way to build the scene in Blender and then import it into Unity?
Would I be able to control the waves and boat after importing them?
Thank you very much for your time and knowledge.
if you really means an ocean, i suggest you to check out NVIDIA WaveWorks. it's a C library and doesn't have an officially integration with Unity3D, but since you go this far for it, i guess maybe you'll have enough courage to trying make it into a useable plugin yourself.

Which is better way for rendering & performance?

I'm making maps for my game. I designed forest for map by using many tree, stone.. Images (insert image into unity scene and arrange it). My game runs well on Android but can not run on iOS (ip4s). It met memory problem. I want to ask everyone:
If i design the forest in photoshop instead of unity, is that way better than my current way?
Thanks all
It depends on what you are trying to do.
But anyway, there is a common way to solve memory usage related problems. Fire up the Profiler!
http://docs.unity3d.com/Manual/Profiler.html
There you can see what is eating your precious memory. So you can try and decide if it's best to make them combined in one image or keep them as separate images. Maybe you would also see the memory problem could be related to other assets you use.
You need to look at Instruments in XCode. Also you can use the Profiler that comes with Unity. Another way you can save memory is by reducing the graphics strain on the screen. You need to see your draw calls and verts, and tris under stats. Keep draw calls under 50-60. And keep verts and tris down. Look at the graphics benchmarks for Graphics on OpenGL, iPhone 4S is an older device and depending on your android may be substantially slower. iPhone 4S has 512MB of RAM I think. This should be enough to handle a pretty big memory load. Check out your OnGUI() objects and calls. You want to mitigate those as much as possible. Also try and use culling to your advantage! Also if you are using Fog or camera filters they take a substantial load as well too. Stay away from Literal Types, too if you can.
Also use Vertex Lit for rendering path vs forward rendering path. Use auto best performance for resolution, too. This will make everything go at 0.75 resolution instead of full retina 960x640 or whatever it is for 4S. You can also in Xcode tweak the resolution, depending on the size of your controls you could make it 0.6
under DeviceSettings.mm in your XCode Project:
case deviceiPhone4S: resMult = 0.6f; break;
or in your MonoDevelop UnityScript (depending on orientation):
Screen.SetResolution (Screen.width * 0.6f, Screen.height * 0.6f, true);

Unity 3D - Particles suddenly becoming transparent

I'm developing a 3D game using Unity3D 4.5.2 (free version, not Pro).
I have used a default Particle System to make a Waterfall. I have placed the Waterfall particle system in the scene in such a way that there is a 2D Sprite of a Mountain behind it.
This is to give an impression to the user that the Waterfall is 'falling' out from the Mountain.
However, after 10 seconds on simulating this waterfall particle system, the particles suddenly become transparent, enabling the user to view the Mountain behind it...have provided screenshots below:
So I would really appreciate if anyone could help me out here, as I've looked at a lot of solutions & fiddled around with all the parameters of the particle system in Inspector but to no avail...
To give you the correct answer for this question, I need see your particle system parameters. But I think something is wrong with "Max Particles" amount or "Color over lifetime". Also check "Start Lifetime", maybe it is too much.

WaveFront OBJ converted from LightWave taking forever to render on iPhone

I'm working on a project where I need to render a 3D human body on an iOS device. The 3D object was built in Adobe LightWave and is 7.4MB. I opened it in Blender and exported it as OBJ/MTL pair which are 5.5MB and 4KB, respectively. Using Jeff LaMarche's Wavefront Loader (linked below) as a starting point to figure out OpenGL ES and get check out performance and whatnot, I stuck the object in there (in place of an OBJ/MTL pair he'd been using) and ran it in the simulator. Of course, crash on startup, so I decided to performSelectorInBackground it. A half hour later, it's still loading.
I'm just guessing that the file is way too detailed to draw with any kind of performance expectation on a device with a 600MHz processor. Is there a way to lower the quality these files somewhat easily? Or, if performance issues have arisen with this particular loader, could somebody enlighten me?
Thanks,
Will
http://iphonedevelopment.blogspot.com/2009/03/wavefront-obj-loader-open-sourced-to.html
Will,
I don't know if I can solve your problem, but I may be able to point you in the right direction. I did a project for a client loading a 3D model exported from Blender using the SIO2 3D engine.
Anyway, at that time, I had trouble with the 3D engine taking a long time to load the model. I found that reducing the number of polygons was very important - if it is a high quality model, you most certainly will need to do so.
Blender has a function for this - polygon reduce or something like that. Blender should also report to you how many polygons and surfaces are in use, so if it's more than, say, 20,000, you're likely in for performance issues.

iPhone. Particle system performance

I try to draw rain and snow as particle system using Core Graphics.
In simulator rendering proceeded fine but when I run my app on real device rendering is slow down.
So, advise me please approaches to increase particle system drawing performance on iPhone.
May be I should use OpenGL for this or CoreAnimation?
OpenGL would be the lowest level to drop to for the rendering, so should offer the best performance (if done right). CoreAnimation would be close enough if there are not too many particles (the exact figure depends on other factors, but upto about 50 should be ok).
When you say you're using CoreGraphics at the moment do you mean you're redrawing based on a timer? If so then CoreAnimation will definitely help you out - as long as you can seperate out each particle into a view. You could still use CoreGraphics to render the individual particles.
Are you using a physics engine to calculate the positions?
If you are simply drawing a view with Core Graphics, then redrawing it every frame to reflect the movement of the particles, you will see terrible performance (for more, see this answer). You will want to go to OpenGL ES or Core Animation for the particle system animation.
My recommendation would be to look at CAReplicatorLayer, a new Core Animation layer type added in iPhone OS 3.0 and Snow Leopard. I've seen some impressive particle systems created just using this one layer type, without using much code. See the ReplicatorDemo sample application (for the Mac, but the core concepts are the same), or Joe Ricioppo's "To 1e100f And Beyond with CAReplicatorLayer" article.
It's hard to give advice with little to no information about your implementation. One thing that is a major bottleneck on the iPhone from my experience are memory allocations. So if you're allocating new objects for each particle spawned, that would be the first thing you might want to fix. (Allocate a pool of objects and reuse them.)