Jump to content

  • Log In with Google      Sign In   
  • Create Account

-XM-

Member Since 17 Nov 2007
Offline Last Active Oct 16 2014 08:21 AM

Posts I've Made

In Topic: MonoGame/HLSL Seperate Texture from sampler

04 September 2014 - 07:53 AM

Ok, I had a few problems.

 

1. I was trying to mix DX9 and DX10 syntax. Use SamplerState for all of your samplers in DX10, sampler for DX9... http://msdn.microsoft.com/en-us/library/windows/desktop/bb509644%28v=vs.85%29.aspx

 

2. My shaders were post process only, no vertex shaders. In DX10 this is a problem because it expects the input of the pixel shader to be the same as the output of the vertex shader. Since I have no custom vertex shader it was defaulting to SpriteBatch's vertex output. Here's what your pixel shader function should look like to match that:

 

float4 CombinedPixelShader(float4 pos : S_POSITION, float4 color : COLOR0, float2 texCoords : TEXCOORD0) : S_TARGET_OUTPUT


In Topic: MonoGame/HLSL Seperate Texture from sampler

29 August 2014 - 01:05 PM

Yeah I'm converting .fx to MGFX, but when I run the game on the MonoGame platform, I see nothing but a clear color.... it said my shaders were converted properly, so I tried to see what this code was doing in XNA4 because I can't debug on the MonoGame platform.

 

I thought the Sample function was available in DX9, it doesn't throw any compiler errors, maybe it's just a fluke that it's running. If I put the ted2d calls back, everything works fine.

 

So, let's assume all of this is valid DX9 code, attaching that Texture2D to that register should give me data right? And theoretically I should be able to call sample like I'm doing without any changes to my C# code?


In Topic: 8-Direction 2D Animations Flicker

23 September 2013 - 08:41 AM

Alright, I'm open if anyone has a better idea but my solution so far is this:

 

1. Store a variable that holds the maxSpeed the AI can run.

2. If the current animation is idle and we want to change to a movement animation, immediately change

3. Otherwise, if we're in a movement animation, stay in this animation unless our velocity exceeds maxSpeed * .8f in the direction we want to change.

 

If you wait until the velocity hits maxSpeed the animation change looks delayed, but if you set that range too low it doesn't catch all of the sudden changes. .8f works fine in my case.

 

I haven't had any problems so far... fingers crossed this did the trick!


In Topic: Dynamic 2D Shadows Optimization

17 February 2013 - 06:56 PM

The max number of hulls I ever draw is about 15.... but I think you guys are right, I just needed to lower my resolution. I didn't understand that most AAA games cheat the 1080p on consoles... I did some research and the only example I saw of a game truly running at 1920 x 1080 was Virtua Tennis 3 (not sure if that's really true). I guess I shouldn't assume so much from the back of the boxes...

 

Thanks for sending me in the right direction guys!


In Topic: Different Timing

05 October 2011 - 07:21 PM

No, I have no problem posting code, but you're right, I never really thought this to be a code issue; I'm starting to see now that I probably am not really using a true timer like you said.

sceneTimer += 1;

if (sceneTimer == 25)
//Cue text or something here. This is really all there is to it, I ++ each time update is called and when the timer reaches a certain amount, I trigger the events of my scene. 

My timer (or rather "counter" I suppose) is an int, and it is added to each time update is called, when sceneTimer == a certain amount, then I call for certain text events to happen etc. From what you are saying, I need to be using GameTime instead of basic int adding? That's really all I have, it's just an int that is being added when I update, and I wait for that int to reach a certain amount and then call events in my scene.

PARTNERS