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

Database for Game Developers (C#/VB.NET)

$
0
0

@SNaidamast wrote:

Apologies to those who thought the formulation of the original writing for this thread was seen as spam.

It was not meant to appear as such, its just that after over 42 years in the corporate development environments my technical writing has become rather "formal".

So I will try to make this information less formal... :relaxed:

I have two data access layers (DALs) that I believe would be very helpful to the MonoGame Community for those developers that are writing their games using the .NET Framework (along with MonoGame).

Two of these DALs make for excellent desktop database applications, Firebird and SQLite.

The frameworks implemented in these software tools have been used for many years in my professional development endeavors so they are relatively stable in design. Everything that comes with each of the packages is completely free and open-source, including the database engines themselves.

You may download either one or both of the zip-file packages from the following links...

FIREBIRD - FB Helper 4.5

SQLITE - SQLite Helper 4.5

Please note the following...

  • The Firebird package comes with both the database engines as well as Firebird documentation. Firebird documentation is somewhat "thin" but an excellent reference manual you will find in this package is the FirebirdLanguage_Reference_25EN.pdf_, which can be found in the "Docs" folder of the unzipped contents of the Firebird Database directory

  • The SQLite package comes with the free versions of the well received database manager, Database.NET. However, only the 32bit version of the package remains entirely free for your use. For a minimal fee you can request from the author a professional license but you really won't require it for the type of database development you will need to do.

Also, please be aware that SQLite uses "generic" data types for the database, which takes specific .NET data types and converts them internally to the corresponding SQLIte data type. For example all .NET float, double, single and integer types will be seen from SQLite as either an INTEGER or a REAL.

If people new to database development need any help or have questions, please either reply to this thread or send me a note at blackfalconsoftware@outlook.com...

Posts: 1

Participants: 1

Read full topic


DirectX Texture Behaviour Not As Expected

$
0
0

@Avan_Madisen wrote:

I've recently been playing with dynamic texture atlas handling and I've found that I receive a crash if I try to set the data for a texture that is larger than 4096, here's a crude example of what I'm doing.

        int Size = 4096;
        Texture2D Test_Tex = new Texture2D(GraphicsDevice, Size, Size, false, SurfaceFormat.Color);
        Color[] Test_Data = new Color[Size * Size];
        Test_Tex.SetData<Color>(Test_Data);

This runs perfectly fine, however if I change the Size value to 4097 I receive the following crash:

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.

I have tested to make sure this isn't due to using a non multiple of 2 size as I can use a size of 4095 without any issue.

Since DX11 can handle textures bigger than 4096 I would've thought this kind of error wouldn't occur unless I tried a size larger than 16384. I also get the same error if I try to create a RenderTarget2D larger than 4096.

My guess is that I might be running in DX9, but I should be in DX11 as I'm using Windows 10 with a DX12 graphics card. Is there a way to tell if I'm running DX9 or DX11 and if so, is there a way to select DX11?

Or is there something stupidly obviously I'm missing here?

Posts: 3

Participants: 2

Read full topic

SpriteBatch.Draw(...) is [deprecated], what to use?

$
0
0

@Rox wrote:

After recently installing MG 3.6 after using 3.4 and 3.5, I noticed that SpriteBatch.Draw(Texture2D texture, ...) was marked as [deprecated] in Visual Studio. Is there a new "best practice" to drawing textures in MG 3.6?

Posts: 2

Participants: 2

Read full topic

[Source Code] some of my own 3D graphics tricks for you guys

$
0
0

@PixelvexDev wrote:

Hey guys, I recently released a 3D game built with MonoGame called Metagalactic Blitz, and I thought I'd share some of my source code for a few 3D graphics techniques that might help you:

http://www.pixelvex.com/gamedev

If you go to that page, you can find my source code and a brief write up for these techniques:

  • 3D Weapon Trails
  • Alpha Masks
  • Capsule Light Source
  • Soft Particles

I hope this helps you guys. I know I wasn't able to find a tutorial for weapon trails anywhere, and only heard about alpha masks a couple of years ago, so I think it'll save you some trouble. The capsule light is a little silly, but I was only find examples of light source that are point lights, cone lights, or directional, so maybe it will help someone see the process in figuring out different shapes. Let me know if this was useful!

Posts: 1

Participants: 1

Read full topic

Disabling multisampling + other anomalies

$
0
0

@Guguhl_Pluhs wrote:

Hello everyone,

I've created a program that uses a tilemap to draw textures from a texture atlas onto a quad using HLSL.

I now however have texture bleeding and I have no idea how to set the SamplerState to sample on Point (so each actual pixel in the texture is used). I have tried setting it manually inside the shader like this:

SamplerState SpriteSheetSampler
{
AddressU = Wrap;
AddressV = Wrap;
MinFilter = Point;
MagFilter = Point;
MipFilter = Point;
};

But there is no visual change. I also tried creating a SamplerState object and setting the Filter to TextureFilter.Point then assigning GraphicsDevice.SamplerStates[0] to this SamplerState object. Then using a register like this: SamplerState SpriteSheetSampler : register(s0); However this also didn't change anything.

Just to be sure, this is what I'm looking at:

And these are the neighbouring tiles of the blue tile:

So it's sampling the purple, yellow and brown from within the blue tile.

Lastly I have these two anomalies that I have no clue what's causing them:
1) Once zoomed out the "dirt" tiles become magnified, and then after a certain point are mirrored (or inverted, I'm not sure) and then become smaller again.

2) Lines appear when zooming out:

I'm hoping someone with extensive (or not) knowledge knows how to fix these issues?

Posts: 2

Participants: 2

Read full topic

Help! Trying to load a song throws SharpDX.SharpDXException

$
0
0

@DKCoder wrote:

I was following a simple tutorial online to learn the ins and outs of monogame for a Desktop application. I started learning how audio works and am now stuck because of a runtime error. I know how to load audio in with the pipeline tool and was able to successfully load in a SoundEffect object using it. However, when I try and follow the same procedure, this time using an mp3 specified to load in as a Song with the pipeline, and try to use Content.Load("songName"), a SharpDX.SharpDXException is thrown along with these details: SharpDX.SharpDXException occurred
HResult=0x80070002
Message=HRESULT: [0x80070002], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: The system cannot find the file specified.

Source=SharpDX
StackTrace:
at SharpDX.Result.CheckError()
at SharpDX.MediaFoundation.SourceResolver.CreateObjectFromURL(String wszURLRef, Int32 dwFlags, ComObject propsRef, ObjectType& objectTypeRef, ComObject& objectOut)
at SharpDX.MediaFoundation.SourceResolver.CreateObjectFromURL(String url, SourceResolverFlags flags, ComObject propertyStore, ObjectType& objectType)
at SharpDX.MediaFoundation.SourceResolver.CreateObjectFromURL(String url, SourceResolverFlags flags)
at Microsoft.Xna.Framework.Media.Song.PlatformInitialize(String fileName)
at Microsoft.Xna.Framework.Media.Song..ctor(String fileName)
at Microsoft.Xna.Framework.Media.Song..ctor(String fileName, Int32 durationMS)
at Microsoft.Xna.Framework.Content.SongReader.Read(ContentReader input, Song existingInstance)
at Microsoft.Xna.Framework.Content.ContentTypeReader1.Read(ContentReader input, Object existingInstance)
at Microsoft.Xna.Framework.Content.ContentReader.InnerReadObject[T](T existingInstance)
at Microsoft.Xna.Framework.Content.ContentReader.ReadObject[T]()
at Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T]()
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action
1 recordDisposableObject)
at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
at _4.Audio.Game1.LoadContent() in A:\Coding Creations\C#\Graphics\4. Audio\4. Audio\Game1.cs:line 31
at Microsoft.Xna.Framework.Game.Initialize()
at _4.Audio.Game1.Initialize() in A:\Coding Creations\C#\Graphics\4. Audio\4. Audio\Game1.cs:line 24
at Microsoft.Xna.Framework.Game.DoInitialize()
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
at Microsoft.Xna.Framework.Game.Run()
at _4.Audio.Program.Main() in A:\Coding Creations\C#\Graphics\4. Audio\4. Audio\Program.cs:line 18

I'm very stuck and don't know what I did wrong. Is there something else I need to install to make this work? Please let me know, I appreciate any help.

Posts: 7

Participants: 2

Read full topic

Erratic input lag during VSYNC ON

$
0
0

@Mark_Rejhon wrote:

Hello,

I discovered a strange behavior in MonoGame.

On a very fast system at 60Hz, most of the time it is 1/60sec (~17ms) between Draw() and the Update() calls and almost instantaneous from Update() back to Draw().

However, occasionally, (about 1 out of 100 refresh cycles), suddenly Draw() then Update() takes 2/60 sec (~33ms). But a smooth scrolling animation shows absolutely no judder at all, and I can see a single frame drop. The subsequent Draw-then-Update becomes suddenly 0/60sec to 'catch' up, before going back to a normal cadence of 1/60sec.

Since Update() does the keyboard reads, I need input reads to occur exactly 1/60sec apart for more predictable VSYNC ON activity -- rather than erratically jittering around 1/60sec from proper input read timing (creating erratic input lag).

I'm using the Stopwatch object (better than microsecond resolution).

I'm getting these numbers (microseconds between Draw() and then Update() as an example:

0.0167842321
0.0167051777
0.0166395418
0.0334241493 <--- Double VSYNC
0.0000173187 <--- Near instant
0.0167538933
0.0167816058

What's causing this sudden major timing jitter? (that doesn't show up as a visual judder of a dropped frame -- motion is still perfectly smooth, zero frame drops).

The VSYNC buffering is probably smoothing it out perfectly with absolutely zero jitters, but the problem is that input reads occur with Update() and these sudden lag jitter is throwing aiming off. (Visualize this example about how important precise input reads are -- A smooth scrolling archery target at 1000 pixels/sec = 17 pixels per refresh cycle. A mis-timed button read that's late, will cause an arrow to miss the dead center when the button is timed perfectly -- because of this strange bug that forces input reads to be out-of-sync with the displayed frame)

This is on a Geforce Titan, so the graphics performance is not an issue here. If VSYNC is OFF (graphics.SynchronizeWithVerticalRetrace = false) then framerate runs at >2000fps, so there is no rendertime issue at play here. Also, garbage collection pattern isn't matching these intervals, so it doesn't seem to be garbage collection either.

Is this a graphics driver behavior or something else?
Or a monogame issue?

Posts: 1

Participants: 1

Read full topic

Physics must be update before entities ?

$
0
0

@Maybeking wrote:

Hello !
I'm building my tiny 2d game engine with very basics physic features and an Entity-Component system. My question is simple: Wich one should I update first ? The physic world, with all the collision detection and response, or my entities ?

Posts: 3

Participants: 2

Read full topic


Acceleration and Friction in 2D games

$
0
0

@Maybeking wrote:

Hello, me again :smile: !
I'm building my own tiny physic engin for my 2D game engin and I want to implement acceleration and friction on my entities wich have velocity. I find a good equation here : https://stackoverflow.com/questions/667034/simple-physics-based-movement

For people who dont want to click, there is the equation :

velocity += acceleration - friction*velocity

But there is a problem :

Let's say I want to calculate the gravity on my entity (Acceleration = 9.83), so i calculate the velocity Y with the equation, and lets say i have 0.5f of friction. So each game step, the following code is applied to my entity:

velocityY += 9.83f - 0.5f * velocityY

So we have this table of velocity for each step :

Step n : velocityY
1 : 9.83
2 : 14.745
3 : 17.2025
4 : 18.43125
5 : 19.045625
6 : 19.3528
7 : 19.5064

And now, as you can see, at the step 4 we have our velocity which increase very slowly and never pass 20.
I know why it do that, its because :
when the half of the velocity reach near of the half of the gravity (9.83), the friction*velocity is almost as much as the gravity.

So I need help maybe to change the equation or improve it !

Thanks you !

Posts: 3

Participants: 2

Read full topic

Maximum graphic size?

$
0
0

@MuntyScruntFundle wrote:

I've seen somewhere, can't remember where, might have been a texture packer, that pretty much all devices, phones, tablets, xbox, pc graphics card have a maximum texture size limit. I'm meaning the x,y dimensions not file size.

How do you (without trial and error) know what these limits are?

Thanks.

Posts: 3

Participants: 3

Read full topic

Image Output Oversaturated?

$
0
0

@mikehaggar wrote:

Hi, everyone! I'm new to MonoGame. I've got a basic project up and running, but it really seems to me that the final output when running the game has oversaturated colors. Is it just me or has anyone else noticed this? If this is a known thing, then are there common solutions? I've googled this, but didn't come up with much. Thanks in advance for any help!

Posts: 4

Participants: 3

Read full topic

I just created a new MonoGame project in Xamarin and it doesn't work

$
0
0

@genesiscz wrote:

Hello,

I tried to create a new solution and just after that run the project, but it does throw an error to me as soon as I try to compile it. The error says

Error: /Users/Martin/Projects/textXNA3/textXNA3/textXNA3.csproj: Input string was not in a correct format. (textXNA3)

I have no idea why. My csproj (not touched) looks like this. What's the matter?

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProjectGuid>{5C447E41-B379-41BA-B71B-5BD56CA39438}</ProjectGuid>
    <ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Exe</OutputType>
    <RootNamespace>textXNA3</RootNamespace>
    <AssemblyName>textXNA3</AssemblyName>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    <MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
    <MonoGamePlatform>DesktopGL</MonoGamePlatform>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug</OutputPath>
    <DefineConstants>DEBUG;</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <EnableCodeSigning>false</EnableCodeSigning>
    <CodeSigningKey>Mac Developer</CodeSigningKey>
    <CreatePackage>false</CreatePackage>
    <EnablePackageSigning>false</EnablePackageSigning>
    <IncludeMonoRuntime>false</IncludeMonoRuntime>
    <UseSGen>true</UseSGen>
    <UseRefCounting>true</UseRefCounting>
    <PlatformTarget>x86</PlatformTarget>
    <IntermediateOutputPath>obj\x86\Debug</IntermediateOutputPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <EnableCodeSigning>false</EnableCodeSigning>
    <CreatePackage>true</CreatePackage>
    <EnablePackageSigning>false</EnablePackageSigning>
    <IncludeMonoRuntime>true</IncludeMonoRuntime>
    <UseSGen>true</UseSGen>
    <UseRefCounting>true</UseRefCounting>
    <LinkMode>SdkOnly</LinkMode>
    <PlatformTarget>x86</PlatformTarget>
    <IntermediateOutputPath>obj\x86\Release</IntermediateOutputPath>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Drawing" />
    <Reference Include="Xamarin.Mac" />
    <Reference Include="MonoGame.Framework">
      <HintPath>..\packages\MonoGame.Framework.DesktopGL.3.6.0.1625\lib\net40\MonoGame.Framework.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Game1.cs" />
    <Compile Include="Main.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Info.plist" />
    <None Include="packages.config" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="Icon.ico" />
  </ItemGroup>
  <ItemGroup>
    <MonoGameContentReference Include="Content\Content.mgcb" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="MonoGame.Framework.dll.config">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <NativeReference Include="libopenal.1.dylib">
      <Kind>Static</Kind>
    </NativeReference>
    <NativeReference Include="libSDL2-2.0.0.dylib">
      <Kind>Static</Kind>
    </NativeReference>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
</Project>

Posts: 1

Participants: 1

Read full topic

About Protogame

$
0
0

@hachque wrote:

Protogame is a powerful cross-platform game engine based on MonoGame. It supports everything from 2D platformers to complex 3D multiplayer games with deferred lighting.

With Protogame's highly modular and flexible design, it aims to support quick development of a wide range of games. You can adopt the parts of Protogame that suit you, and you can very easily replace or modify existing low-level functionality to get the exact behaviour you need.

Important Links

What's this category for?

This category is for community support and discussion of Protogame. If you need to ask questions on how to get something done or if you're having trouble getting started, this is the place to ask.

If you have a definitive bug report, or you have a feature request, please file these at the issue tracker linked above.

You'll find important topics like how to get started and documentation links pinned in the category itself.

Posts: 1

Participants: 1

Read full topic

"Generic" achitecture

$
0
0

@Alkher wrote:

Hi !

I have a somewhat simple problem (at least, easy for me in c++ with pointers and classes aggregation, but not with c#)

I need, in order to optimize my classes, to have a class like this:

class Object_Default
{
	public Vector3 _Pos3D;
	public Texsture2D _TexChannelA;
	... (other mandatory properties)
}

and I need some versions of this class to be "specialized" with more properties:

class Object_OnlyColor:Object_Default
{
	public Vector4 _Color;
    //Other props
}

class Object_LightnShadows:Object_OnlyColor
{
	public bool _IsReceivingLight;
	public bool _IsCastingShadows;
	public bool _IsCastingLight;
	public bool _IsReceivingShadows;
    //Other props
}

How can I have a generic array of one of these types, without having to test the type each frame with:

if(_objectsarray is Object_OnlyColor[])
{
//Do something according to this type: set values to be used with the effect, etc.
}
else
if(_objectsarray is Object_LightnShadows[])
{
//Do something according to this type: set values to be used with the effect, etc.
}

Is there anyone with a good architecture, with fast performances ? I don't think creating a "object" type array and casting it each frame would solve this. And I'm not sure an abstract class is the solution. Since aggregation is not possible with C#, how to achieve this ?

Posts: 8

Participants: 4

Read full topic

Inheiritance and virtual methods.

$
0
0

@willmotil wrote:

This is a example for reference. This is so that i can just link to it as a reply to similar questions. Feel free to expand on it as you like.

This is a basic console example.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InheiritanceAndBaseDerivation
{
    class Program
    {
        static void Main(string[] args)
        {
            AnimalLover me = new AnimalLover();
            me.Draw();
            Console.ReadLine();
        }
    }
    public class Animal
    {
        public string objectTypesName = "Animal";
        public string noise = "...";
        public virtual string Speak
        {
            get { return noise; }
            set { noise = value; }
        }
        public virtual void Update()
        {
            
        }
        public virtual void Draw()
        {
            Console.WriteLine(objectTypesName + " " + Speak);
        }
    }
    public class Cat : Animal
    {
        public Cat()
        {
            objectTypesName = "Cat";
            Speak = "Meow";
        }
    }
    public class Dog : Animal
    {
        public Dog()
        {
            objectTypesName = "Dog";
            Speak = "Ruff";
        }
        public override void Draw()
        {
            // because dogs like to speak alot
            Console.WriteLine(objectTypesName + " " + Speak + " " + Speak);
        }
    }
    public class Lizard : Animal
    {
        public Lizard()
        {
            objectTypesName = "Lizard";
        }
    }
    public class AnimalLover
    {
        List<Animal> animals = new List<Animal>();
        public AnimalLover()
        {
            animals.Add(new Animal());
            animals.Add(new Cat());
            animals.Add(new Dog());
            animals.Add(new Lizard());
        }
        public void Update()
        {

        }
        public void Draw()
        {
            foreach (Animal item in animals)
            {
                item.Draw();
            }
        }
    }

    // Output as follows
    //
    // Animal ...
    // Cat Meow
    // Dog Ruff Ruff
    // Lizard ...
    //
}

Posts: 1

Participants: 1

Read full topic


Multi page sprite sheet.

$
0
0

@MuntyScruntFundle wrote:

Hi folks. Question of the day:

I have a sprite class which currently runs on a single sprite sheet. It self advances and retreats as needed, works lovely.

But at present the Parent class holds the Texture, the child just holds pointers and returns an empty Rectangle for the draw routine to use.

I'm now at the point where some sprites are needing multiple sheets. I want to pass all the sheets to the class and store them in a list, but this poses a problem. This means the child class has to pass a texture back to the parent class for drawing.

Or is this a problem? Is creating the required texture in the child class going to be that expensive?

At the moment it's only one sprite in the game that needs to be coded this way, but I'd like to unify the code as much as possible, meaning many, many sprites will work this way.

From looking around it looks as if I can either create a Render Target, or copy the data with SetData.

Do you folks have any views on which way to go? I need to contain the code in the child class otherwise the parent class is going to get out of control!

Thanks.

Posts: 2

Participants: 2

Read full topic

Rendering Depth Buffer and Shadow Map (debug)

$
0
0

@skyemaidstone wrote:

I've just about got my engine converted from XNA to Monogame with a few headaches.

Shadows don't work and animation is broken too (models just don't appear for some reason i can't fathom).

My engine uses deferred lighting which seems to be working nicely but for somer reason my debug shadowmap render target and depth buffers don't contain anything sensible or there's some new way of displaying them in Monogame.

Currently my depthmap and shadowmap targets (multiple due to cascaded shadow mapping) are defined as:

shadowHQRT = new RenderTarget2D(GraphicsDevice, 4096, 4096, false, SurfaceFormat.Single, DepthFormat.Depth24);

And I render my little debug boxes (so i can visualize the depthRT and ShadowRTs) with:

_debugSB.Begin(SpriteSortMode.Immediate, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.DepthRead, RasterizerState.CullNone, debugshadowRTeffect);
            _debugSB.Draw(shadowHQRT, new Rectangle(1200, 300, 300, 150), Color.White);
            _debugSB.End();

The shadow used for SpriteBath is just:

uniform extern texture ScreenTexture;

sampler screen = sampler_state
{
Texture = ;
};

float4 PixelShaderFunction(float2 inCoord: TEXCOORD0) : COLOR
{
float4 color = tex2D(screen, inCoord);

color.rgb = (color.r+color.g+color.b)/3.0f;

//color = pow(color, 30.0f);

return color;

}

technique
{
pass P0
{
PixelShader = compile ps_4_0 PixelShaderFunction();
}
}

My depthRT just renders as a grey square.

Posts: 8

Participants: 4

Read full topic

Solution for playing videos on Linux?

$
0
0

@Rafael_Bringel wrote:

So I've been searching for some time trying to port my XNA game to linux, everything runs nice and smoothly and the last thing there is to port are the videos which I use at the end of every stage. But after some research ir appears that the VideoPlayer class wan't implemented yet on the DesktopGL version.

I've hear that there is a way to use SDL2 to play videos but couldn't find anything about it anywhere.

So, is there a solution to play videos on the Linux platform?

Posts: 1

Participants: 1

Read full topic

Monogame and Visual Studio Online (TFS)

$
0
0

@Sven_Jutte wrote:

Hello Guys,

has someone get the BuildAgent work for MonoGame Windows Projekts in Visual Studio Online?

Posts: 5

Participants: 3

Read full topic

Weird Texture2D Bug?

$
0
0

@mikehaggar wrote:

I have a 960x540 image. It's a row of black pixels followed by a row of transparent pixels then a row of black pixels followed by a row of transparent pixels etc... Basically, it starts with a row of black pixels and alternates between that and a row of transparent pixels. That's all there is to it. Anyway, when I draw this image using spriteBatch to a 960x540 RenderTarget 2D at some point the spacing between the rows gets messed up. A pattern is formed and every 40 pixels or so two of the black rows appear next to each other. I've recreated the images multiple times and this still happens with every version. I've also triple-checked the size of the RenderTarget2D, the size of the image, the size of the draw Rectangle for the image supplied to SpriteBatch etc... I'm sort of at a loss...

Posts: 11

Participants: 4

Read full topic

Viewing all 6822 articles
Browse latest View live