Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all 6664 articles
Browse latest View live

do i need a mac to distribute my game to OS X platform?

$
0
0

@SoundGoddess wrote:

I'm developing on Window 10 with VS2015. I want to create a .app file suitable for deploying my game to OS X.

Do I need to just break down and buy a cheap used Mac Mini from eBay for ~$125 and set it up for local VNC so I have a way to test and deploy on OS X? Or is there a way I can avoid this and sitll deploy without having direct access to a Mac?

I do have OS X Mavericks running on VirtualBox, but it's really buggy and my game doesn't work on there.

Posts: 3

Participants: 3

Read full topic


Pipeline tool (dev): open a project = exception

$
0
0

@InfiniteProductions wrote:

Using dev snapshot of the pipeline tool, since almost last week, I got this exception when using open (also new or import):

System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à Eto.WinForms.Forms.WindowsFileDialog2.<>c.<SetFilters>b__9_0(FileDialogFilter f)
à System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext()
à System.String.Join(String separator, IEnumerable1 values)
à Eto.WinForms.Forms.WindowsFileDialog
2.SetFilters()
à Eto.WinForms.Forms.WindowsFileDialog`2.ShowDialog(Window parent)
à MonoGame.Tools.Pipeline.MainView.AskOpenProject(String& projectFilePath) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\Tools\Pipeline\Eto\MainWindow.cs:ligne 67
à MonoGame.Tools.Pipeline.PipelineController.OpenProject() dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\Tools\Pipeline\Common\PipelineController.cs:ligne 221
à MonoGame.Tools.Pipeline.MainView.OnOpenProjectClick(Object sender, EventArgs e) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\Tools\Pipeline\Windows\MainView.cs:ligne 509
à System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
à System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
à System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
à System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ToolStrip.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Pipeline tool from official MG 3.5.1 build works (fortunately for me).
Projects are build using protobuild for WinDx platform on win7 64b.

I've tried to use VS 2015 WD but it is unable to run the debug session, executable is allegedly "locked" by some unidentified process, VS can't generate it :/, resource monitor doesn't show any such process (looks like VS mess up with itself in this case !)
EDIT: one pipeline process was running (??) in the background preventing the file to be modified/deleted.
Exception occured in AskOpenProject (MainWindow.cs) method on line:
var result = dialog.ShowDialog(null) == Eto.Forms.DialogResult.Ok;

Anyone have this too ?
Should I report an issue ?

Thanks.

Posts: 6

Participants: 2

Read full topic

Monogame Sources via Git / ProtoBuild

$
0
0

@Alkher wrote:

Hi !
I tried to get sources from protobuild.exe but i always get a code 128 when trying to build for windows.
Cloning from git under visual 2013 doesn't provide *.csproj nor *.sln
Did i miss something to be able to build the dll myself ?

Posts: 8

Participants: 3

Read full topic

The color values ​​of the shader does not work.

$
0
0

@NeoBlogKossy wrote:

*I'm sorry in dub English. (I'm Japanese)

I am using for the first time the Monogame. (Ver 3.5)
I was using in the XNA (SM3.0), but was ported to MonoGame (SM4.0).
In XNA it was displayed properly.
Cause I do not know, but it disables the color values ​​in the shader.

sample code

struct sVS_INPUT_PN
{
    float4 f4Pos0: POSITION0;
    float3 f3Normal0: NORMAL;
};

struct sVS_OUTPUT_PC
{
    float4 f4Pos0: POSITION0;
    float4 f4Color0: COLOR0;
};

struct sPS_INPUT_C
{
    float4 f4Color0: COLOR0;
};

sVS_OUTPUT_PC vs_PN (sVS_INPUT_PN In)
{
    sVS_OUTPUT_PC Out;
//
// Vertex calc(omit)
//

Out.f4Color0.rgba = max(0,dot(vNormalWorldSpace, gLightDir3));


   // Test code A
// Out.f4Color0 = 1;

    return Out;
}

float4 ps_C (sPS_INPUT_C In): COLOR
{
    // Test code B
// In.f4Color0 = 1;
    return In.f4Color0;
}

technique technique_PC
{
    pass Pass1
    {
        VertexShader = compile vs_4_0_level_9_1 vs_PN ();
        PixelShader = compile ps_4_0_level_9_1 ps_C ();
    }
}

1) test code A Comment out (test code B is Comment)
The output color of VertexShader, even if forced assignment, color is still black.

2) test code B Comment out (test code A is Comment)
The output color of PixelShader, if you force assignment, the color is white.

Why?
Vertex Shader of color, it seems not to have been passed to the Pixel Shader.
It is pitch black, but since the vertices are depicted, vertex data is no problem.
Both, to become white is the correct answer.

Posts: 11

Participants: 4

Read full topic

Can I use the MRT?

$
0
0

@NeoBlogKossy wrote:

*I'm sorry in dub English. (I'm Japanese)

Multiple Render Target is available in MonoGame(3.5)?
In the remains of the code that was ported from XNA, it looks like not moving.

Posts: 6

Participants: 3

Read full topic

Updating to latest development build breaks everything

$
0
0

@kosmonautgames wrote:

Hi guys,

I guess I should have posted this in the Git Issues, but oh well.

I am a noob, so let's go.

I used 3.6.183 for a while, wasn't sure if the MSAA worked already in that one (since it didn't for me) so I decided to upgrade to the current version (read: load the development build installer from the downloads page) - as i did many times before. I am using the DirectX branch for my project.

Well now basically everything that has to do with graphics fails. I cannot load FX files, even the ones that are basically empty.

_lightingEffect = content.Load<Effect>("FX/LightShader");

->

An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll

Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.

When I comment them out, just to see what happens it throws another error where I can't assign an indexBuffer and I get a NotSupportedException.

_indexBuffer = new IndexBuffer(graphicsDevice, typeof(int), terrainManager.Indices.Length, BufferUsage.WriteOnly);

->

NotSupportedException
A first chance exception of type 'System.NotSupportedException' occurred in MonoGame.Framework.dll

Additional information: The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes.

Which is really stupid, since I need int instead of short in cases of very large models. It worked before, why does it not work any more?

Well it doesn't stop there.

If I comment that out again, just to see what happens -> All my rendertargets are incorrect now. Can't load them.

_bloomRenderTarget2DMip0 = new RenderTarget2D(_graphicsDevice,
(int) (width * GameSettings.SuperSample),
(int) (height*GameSettings.SuperSample), false, SurfaceFormat.Rgba1010102, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);

->

`An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll

Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.`

it continues from there...

What did I do wrong?

I basically just installed the current version of MonoGame with the provided installer, like i did before (aka overwrite the old files)

--

So now I rolled back to MG 3.5.1 and everything is working again, but yeah, doesn't fix the issue.

--

Second Question:

Can someone provide a link with a how-to to build the MonoGame Framework manually for Windows? I thought it to be trivial, but I failed due to so many different things, I'd rather just start with a clean description.

Posts: 5

Participants: 3

Read full topic

How to draw a render target onto an existing image on backbuffer without overwriting?

$
0
0

@greyp wrote:

I'm trying to draw a render target to the back buffer:

spriteBatch.GraphicsDevice.SetRenderTarget(renderTarget);
spriteBatch.GraphicsDevice.Clear(Color.Transparent);
spriteBatch.Begin(SpriteSortMode.Deferred,
                BlendState.AlphaBlend,
                SamplerState.LinearClamp,
                DepthStencilState.None,
                RasterizerState.CullNone,
                null);
spriteBatch.Draw(renderTarget, Vector2.Zero, Color.White * TransitionAlpha);

The backbuffer already has something drawn on it and I want the render target to blend in without overwriting it. But the result is that the render target completely replaced the image on the backbuffer (transparent part turned purple). How can I solve this issue?

Posts: 7

Participants: 4

Read full topic

Rendering issues with shaders only on Android

$
0
0

@Draih wrote:

I have a problem I've been working on for a few days porting my current work to Android, I have quite a few shaders that I've tested on Windows 10, Windows Phone, and Windows GL projects, and I have them all working correctly:


Windows Version with DirectX


Windows Version with OpenGL

However, I've had multiple issues porting these shaders onto Android. My first attempt in porting resulted in all of my graphics turning bright red, as referenced in http://community.monogame.net/t/second-spritebatch-draw-always-turns-textures-red/2715 to which I was able to fix this issue by explicitly writing my own pass-through vertex shader (I have no idea why this worked). However, my new issue is that either the vertex shader or the pixel shader is not operating on Android, as seen here:


Android Version, Platform 5.0.1, API Level 21, background not working

The shader responsible for managing this background work is a fairly simple Gaussian blur with a few settings (simplified to cut down on reading):

#define pixelX (10.0 / 1300)
#define pixelY (10.0 / 740)
#define reduction 0.22

float2 Viewport;

void SpriteVertexShader(inout float4 position : SV_Position, inout float4 color : COLOR0, inout float2 texCoord : TEXCOORD0)
{
    // Correction for texel centering.
    position.xy -= 0.5;
    // Viewport fix.
    position.xy = position.xy / Viewport;
    position.xy *= float2(2, -2);
    position.xy -= float2(1, -1);
}

sampler TextureSampler : register(s0);

float4 HorizontalGaussianBlur(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
    float4 tex1 = tex2D(TextureSampler, texCoord + float2(pixelX * 6, 0));
    ...
    float4 result = (0.7 * tex1 + 0.9 * tex2 + tex3 + 1.1 * tex4 + 1.2 * tex5 + 1.3 * tex6 + 1.4 * tex7 + 1.3 * tex8 + 1.2 * tex9 + 1.1 * texA + texB + 0.9 * texC + 0.7 * texD);
    return float4(result.r * reduction, result.r * reduction, result.r * reduction, 1);
}

...

float4 EffectOff(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
    float4 tex = tex2D(TextureSampler, texCoord);
    return tex * color;
}

technique BlurTechnique
{
    pass HorizontalGaussianBlurPass
    {
#if HLSL
        VertexShader = compile vs_4_0_level_9_3 SpriteVertexShader();
        PixelShader = compile ps_4_0_level_9_3 HorizontalGaussianBlur();
#else
        VertexShader = compile vs_2_0 SpriteVertexShader();
        PixelShader = compile ps_2_0 HorizontalGaussianBlur();
#endif
    }
    ...
}

So my primary question is: Am I doing something wrong when working with Android, such as missing a step when preparing my shaders, or do I have some underlying bug in my shaders that I'm not seeing?

Posts: 4

Participants: 2

Read full topic


No Mac or Linux Project template?

$
0
0

@Halofreak1990 wrote:

I'm trying to add Linux support to a MonoGame Windows App project (using MonoGame 3.5) but I cannot find a Linux project template (or one for the Mac, for that matter). The only thing remotely close is a DesktopGL project, which, I've read, creates OpenGL projects for Mac, Linux and Windows. Since I already have a Windows project, creating a DesktopGL project only to throw away the Windows version seems a little backwards. Is there a better way to achieve what I want?

Posts: 2

Participants: 2

Read full topic

MG can't detect my gamepad

$
0
0

@greyp wrote:

I have a wired Xbox 360 controller connected to my PC and it works fine with Steam games. But in my MG project, it cannot be detected by MG -- GamePad.GetState((PlayerIndex)0).IsConnected always returns false. Can someone tell me if I'm doing things in a wrong way or is it something else? (I am on Windows 10) Thanks very much! :slightly_smiling:

Posts: 4

Participants: 2

Read full topic

System.InvalidOperationException: Shader Compilation Failed

$
0
0

@Alex wrote:

I'm porting a number of shaders from my current UWP game to Android. I followed the instructions here: http://www.monogame.net/documentation/?page=Custom_Effects.

A simple WxVxP + single texture shader runs fine, but a more complex diffuse + normals + specular maps shader gives "System.InvalidOperationException: Shader Compilation Failed" at runtime.

What exactly is this exception (the shader compiled successfully) and is there a way to see more details about it?

Tested this with Microsoft's Android emulator.

Posts: 1

Participants: 1

Read full topic

MediaPlayer not playing full song

$
0
0

@James_Maslaki wrote:

The song is 14 seconds long and it only plays about a second or less of it.. here is the code I'm using:

Song soundHeavenRetro;

protected override LoadContent{
soundHeavenRetro = Content.Load<Song>("Music/heavenretro");
}

protected override Update(GameTime gameTime){
MediaPlayer.Play(soundHeavenRetro);
}

So yeah, it plays for one second but that's it. I don't know what's wrong with it

Posts: 3

Participants: 2

Read full topic

Handling MonoGame content with git

$
0
0

@eddeland wrote:

What is the best way to use git to track your MonoGame project? If content files are changed frequently, even if not by much, the repository size will grow pretty fast. How do you handle game content when using git to track a MonoGame project?

Posts: 3

Participants: 3

Read full topic

Multithreading in a contentprocessor

$
0
0

@Alkher wrote:

Hi.
I have a question concerning threads in a contentprocessor.
Is it thread safe to use some sort of map reduce to accelerate the computations on huge models ?
At least is it possible to use Parallel.Invoke on a mesh to traverse meshparts a litle faster : with xna i had a lot of huge models and lots of submeshes to process and it took about 15mins to build without compression to speed it up. On an i7 @ 2.8ghz up to 3+ghz.

Posts: 3

Participants: 2

Read full topic

How to check if Rectangle intersects with only one instance

$
0
0

@James_Maslaki wrote:

I have a Player.cs and a list of HeavenVillager.cs called HeavenVillagers

how do I check if the player's Rectangle(player.Box), intersects with ANY or one of the villagers' boxes

this is what doesn't work:

for (int i = 0; i < HeavenVillagers.Count; i++){
if (player.Box.Intersects(HeavenVillagers[i].Box){
//intersected
}
}

Posts: 2

Participants: 2

Read full topic


Loading shader at runtime fails

$
0
0

@Jjagg wrote:

Hey guys,
I'm working on some shaders and when compiling 2MGFX complained saying "not enough arithmetic instruction slots", so i upgraded the pixel shader profile to ps_4_0 (using DX for now). I wanted to load effects from binary by extending Effect and calling base(GraphicsDevice, effectBytes) like MonoGame does for the stock effects , but after the shader profile upgrade SharpDX gives me a runtime exception "The parameter is incorrect". After googling around a bit, it seems this can mean pretty much anything. Any ideas what might be causing this/how to solve this? Profiles ps_4_0_level_9_3 and lower work fine, but 512 instruction slots is still not enough :confounded:
Also, does anyone know what devices don't support ps_4_0 or where I can get a list of supported devices per shader profile? Thanks!

Posts: 8

Participants: 3

Read full topic

PlayStation Platforms

$
0
0

@IceIYIaN wrote:

MonoGame supports PS4 and PS Vita. At one point also PlayStation Mobile. Just wondering if there was any plans to go to their legacy systems. PlayStation 3 and the like. Is something like that even a possibility? I don't know about PS3's digital marketplace, but 80++ million units or whatever that may be is quite the number.

Posts: 2

Participants: 2

Read full topic

deferred/forward rendering "simple" code

$
0
0

@InfiniteProductions wrote:

Does anyone here have or know some deferred rendering, or maybe forward rendering, code which could be not -too) painfully added to any 3D project ?
I mean something which is not an all-in-one engine with sounds, physics, editor, etc but also a more detailed example than Catalinzima "tutorial" for instance.

Also, I have found this tutorial but unfortunately, the author website is gone now, and there is no way to get code unless anyone would have a backup around.

One point still bugging me is all author always use a custom content processor without giving any good enough explanation on why they're doing so; which looks like to be common in graphics programming, people usually repeat what they read somewhere else without explaining what and why: "it is this way period, don't ask", maybe they don't even really understand everything (as when you truly understand something you can explain it from A to Z, if you can't, it's because you don't understand, and/or don't know part of the "under the hood" stuff).

As C# has Object Oriented Design in its DNA, could it be any way to specialize an exiting content processor to add more properties/tings to it ? Does the objects absolutely need to carry something more ? Does the material/visual properties of objects be separated from the meshes ?
There are a lot of question which seems to be kept far away :/.

So, thanks for reading.

Posts: 3

Participants: 3

Read full topic

Windows key is minimizing my game if it is maximized or fullscreen

$
0
0

@CidHighwind wrote:

If I maximize or set my game to fullscreen and then press the windows button my game minimizes. Should this happen? Because I would like to record the game with the xbox app and for this I need to open it ingame with "windows + G". So I am not able to record maximized or in fullscreen.

Posts: 1

Participants: 1

Read full topic

Layers Bugged?

$
0
0

@MuntyScruntFundle wrote:

I was playing about with layers yesterday, I was getting some extremely odd results, to the point that my nut was so well and truly mangled I decided never to touch them again, and went back to simple ordered drawing.

I have a sprite of a car body, just the body. Then I have other sprites for the lights, I draw the lights in the same position as the body sprite, so I can turn on indicators, front, brake, reversing lights without having to create a graphic for every single combination. This approach was the only one that made any sense to me.

Now, the drawing routine was setup to to draw Front to Back, so layer 0.0 would be the back, and 1.0 would be foremost. I built up the scene as you would expect, background, car, hedges, bridges, trees etc, all in the logical order. This was fine, however, when I turned on any lights of the car the color of my car body changed, not dramatically, but it got lighter. I tried putting the lights on a different layer, so the car was on 0.2 and the lights were on 0.3, still the same. My car body also changed colour at certain points in the world without any reason, but in repeatable places. During testing I tried setting up a trigger location, so when the car was within certain screen positions a different sprite would be drawn, the car body changed color. This wasn't on the same layer!

The reason for wanting layers was so I could change the car layer so it could run over and under certain parts of the 2d world. This is where the next strange behaviour was noticed. If I moved the car from 0.2/0.3 to 0.5/0.6 items on layer 0.1 started drawing in a different order. I honestly thought I was going bonkers. I tried all sorts of different combinations but no matter what I tried I couldn't get around the car body changing color when the lights were turned on. I'm sure you'd be quite alarmed if every time you put your foot on your brake pedal your car changed color, or when you turned on indicators the whole care flashed! This wasn't an acceptable situation.

So, layers. What's going on?

Posts: 2

Participants: 2

Read full topic

Viewing all 6664 articles
Browse latest View live


Latest Images