I am looking to work with the XNA framework to develop some simple 2D games. I especially would like to be able to develop and debug portions of these games while on-the-go with my netbook. Unfortunately, my netbook's GPU does not support the Shader Model 2.0 that is required by XNA.
Frustrated, I went to Google looking for alternatives. I came across one alternative from "Riemers XNA Tutorial". The following code is supposed to force XNA to run strictly through a computer's CPU, thus allowing my netbook to run an incredibly slow version of XNA.
if (GraphicsAdapter.DefaultAdapter.GetCapabilities(DeviceType.Hardware).MaxPixelShaderProfile < ShaderProfile.PS_2_0)
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs> (SetToReference);
}
void SetToReference(object sender, PreparingDeviceSettingsEventArgs eventargs)
{
eventargs.GraphicsDeviceInformation.CreationOptions = CreateOptions.SoftwareVertexProcessing;
eventargs.GraphicsDeviceInformation.DeviceType = DeviceType.Reference;
eventargs.GraphicsDeviceInformation.PresentationParameters.MultiSampleType = MultiSampleType.None;
}
The above code is supposed to be placed in the Game1 method of a default XNA project.
The problem is that when I try to run this new project I receive the following two errors:
Error 1 'XNAReferenceDevice.Game1.LoadGraphicsContent(bool)': no suitable method found to override c:\users\richard\documents\visual studio 2010\Projects\WindowsGame1\WindowsGame1\WindowsGame1\Game1.cs 39 33 WindowsGame1
Error 2 'XNAReferenceDevice.Game1.UnloadGraphicsContent(bool)': no suitable method found to override c:\users\richard\documents\visual studio 2010\Projects\WindowsGame1\WindowsGame1\WindowsGame1\Game1.cs 46 33 WindowsGame1
These two errors also cause blue 'squiggly' lines to appear beneath the LoadGraphicsContent and UnloadGraphicsContent methods.
If anyone could help me solve this problem or point me in a different direction, that would be great.
Thanks in advance!
New versions of XNA lost some compatibility with the past.
Probably you are using a newer version of the framework and of XNA than Riemers tutorials.
However, consider that new XNA 4.0 supports minimum pixel shader 2.0! It means you cannot run it on low end machines with only pixel shader 1.1 or with a too slow pixel shader 2.0.
Previous version, XNA 3.1, supports minimum pixel shader 1.1, you can try to switch back to that using visual studio 2008 express.
Sorry but since XNA requires good machines I think you should find a better machine, also for doing 2D graphics.
The compiler error however is not related to pixel shader but is related probably to XNA and C# versions.
Related
The same project compiled on the identical versions of Windows 10 and Visual Studio 2015 but on different hardware (Asus laptop and Surface Pro 4) produces different results: some elements (like MapPolyline and borders of MapPolygon) are not drawn along with the whole streets outlines and such (see the attached screenshots)
Expected behavior
Problematic behavior
Does anybody experience similar behavior and/or know how to fix that?
I think this is the same bug as reported here http://answers.microsoft.com/en-us/windows/forum/apps_windows_10-win_maps/windows-10-maps-app-sometimes-does-not-show-the/7183916a-9567-4d49-ab92-297eec8737ab?auth=1 Microsoft is working on a fix...
How does one do image processing & manipulation in an iPhone application?
I would like to include below 3 important steps:
access raw RGB from image data
apply any image processing (edge detect, grey-scale, contrast & color).
create a new image from this modified data.
I got few links with color & contrast, but still looking for edge detection just from the corners of the image.
Here are the links:
https://launchpad.net/imagemagick/main/6.3.2-2
http://code.google.com/p/image-tools2009/source/checkout
http://www.google.com/codesearch#I0cABDTB4TA/pub/FreeBSD/
Is there any other open source code available for these functionalities?
Your question highlights open source frameworks - but I'm going to throw my answer behind Apple's CoreImage framework that is now available in iOS5. CI has been around as an OSX framework for a very long time and as of iOS 5+ you can use a subset of the filters in iOS.
Advantages include:
Very powerful
Highly Optimised
Been around for ages
Ray Wenderlich has great tutorials and he has one on "Beginning Core Image in OS5" which I think might be right up your alley. He talks of the fundamental parts like CIContext, CIImage, CIFilter.
The second place you should look is the Core Image Programming guide for iOS and then CoreImage Filter Reference from Apple. The filter reference mentions which filters are available in iOS.
If you're finding that all a bit difficult, I think you may need to step backwards into CoreGraphics to learn the underlying basics of graphics on iOS - but that's outside the scope of this question.
Is there a reason that UITouch's locationInView: is unaware of the presence (or not) of a retina display? Why is the rescaling for retina display left as a task for the developer. Seems odd to me.
Thanks,
Doug
It's by design. The location is reported as in points, not as in pixels. From Apple's Event Handling Guide:
iOS 4.0 still reports touches on iPhone 4 (and on future high-resolution devices) in a 320x480 coordinate space to maintain source compatibility, but the resolution is twice as high in each dimension for applications built for iOS 4.0 and later releases.
So I've looked around, and since I have found no information on the subject, I assume 3DSMax does not support GLSL shaders? Is this correct?
I am using 3DSMax 2010 and 2011, and am sick of writing two versions of the same sets of shaders - one for my application and one for 3DSMax. So much gets lost on the crappy workflow :(
Does anyone have any information on how to render with GLSL shaders in 3DSMax 2010 or 2011?
Any help would be greatly appreciated.
Thanks in advance!
For 2010 and higher the directX material also supports CGFX shaders as well as HLSL. Both formats might require slight tweaking to support 3ds max's parameter system as well as a game engine.
In 2011 and 2012, Autodesk added support for metaSL, a format from NVIDIA (formerly mental images). MetaSL shaders can export into CG, HLSL, GLSL, and also MentalRay Shaders.
The metaSL export or compliation engine is available via the mental mill integrators edition (expensive). This is for game engine writers that want users to author additional shaders. eg. UnReal, Unity3d etc.
Content (ie. metasl, glsl,hlsl, etc,) can be created via mental mill standard edition which is free with a license of 3ds max 2011 and higher. (500$ without 3ds max)
There is also a way to author metaSL shaders directly in the 3ds max 2012 schematic material editor removing the need for mental mill as a standalone product.
it supports DirectX shaders and metasl shaders.
You can code your own shaders (maxscript, c++ plugin, metasl) to fill the gap.
But you will not be able to see a unsupported material in the viewport.
Vray 2.0 supports rendering of GLSL shaders on 3dsmax 2011 and above, though it is by no means a free rendering engine.
Vray:
http://chaosgroup.com/en/2/vray.html
GLSL Documentation:
http://www.spot3d.com/vray/help/200R1/vrayglsltex.htm
I have Windows CE 5.0 device and it doesn't support any hardware accelearation.
I am looking for some good 2d graphics library to do following things.
I prefer backend programming in Compact .Net Framework.
Drawing fonts with antialiasing.
drawing lines, and simple vector objects with antialiasing.
I am not doing animation, so i don't care about frames per seconds performance.
i have looked into following libraries, but nothing suits me.
opengl (vincent 3d software rendering) - works, but api is very low level and complex.
openvg - no software implementation for windows ce.
Cairo - api is very neat, but no wince build.
Adobe Flash - installs as browser plugin , no activex support in wince.
Anti-aliased fonts in .Net CF 2.0+ can be done with Microsoft.WindowsCE.Form.LogFont -- after creating your logfont, you can use it with any WinForms widget's .Font property by converting it using System.Drawing.Font.FromLogFont().
...you might need to enable anti-aliasing in the registry for these to render properly, see this MSDN article for the right keys: [http://msdn.microsoft.com/en-us/library/ms901096.aspx][1].
There was a decent implementation of GDI+ for .Net CF 1.0 called "XrossOne Mobile GDI+", it's not longer supported, but you can get the source code here: http://www.isquaredsoftware.com/XrossOneGDIPlus.php -- Run it through the import wizard on VS2008 to build it for later versions of CF. I liked this library for its alpha transparency support without hardware acceleration, rounded rectangles and gradient support.
Someone was advertising this library in some forum. It's for Windows Mobile, but you can check it out. I have no experience with it.
link
I have Google's skia library compiling under WindowsCE, although I haven't done much with it yet :) It wasn't too hard to get working. It does support a OpenGL/ES backend.
There is also AGG (Anti Grain Geometry) which is a heavy C++ library based on templates.