Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualxDarkice

Posted 09 January 2012 - 03:25 PM

I am not recreating the texture each frame. I keep all textures stored in a List and they can be updated using my UpdateTexture methods. The textures are drawn in my DrawTexture methods.

Your post really helped me out. Instead of writing the data directly into the stream i am now doing this which works like a charm:

DataRectangle rect = t.LockRectangle(0, LockFlags.None);
			for(int i = 0; i < Data.Length;) {
				rect.Data.Write(Data, i, 4 * W);
				i+= 4*W;
				rect.Data.Position = rect.Data.Position - 4 * W;
				rect.Data.Position += rect.Pitch;
			}
			t.UnlockRectangle(0);

The hopefully last minor bugs are that my z-position isnt applied correctly and the textures are still a bit blurry.
The small album art should be rendered over the big one. It is working fine in OpenGL, but z-Positions can go beyond 1.0f in OpenGL. If I draw my z-Positions with values over 1f they wont show up. I am currently setting any positions over 1f to 1f which creates this bug i think.
The other thing is that the textures are not that good as in OpenGL. I experimented with some TextureFilters ending up using a linear filter, which is still not too fine. In OpenGL i am using MipMaps to have smooth textures. Can I do the same in DirectX?

EDIT: Fixed z-Positions, still need to examine why the textures are a bit blurry though I am shifting the Pixels by 0.5

#3xDarkice

Posted 09 January 2012 - 12:56 PM

I am not recreating the texture each frame. I keep all textures stored in a List and they can be updated using my UpdateTexture methods. The textures are drawn in my DrawTexture methods.

Your post really helped me out. Instead of writing the data directly into the stream i am now doing this which works like a charm:

DataRectangle rect = t.LockRectangle(0, LockFlags.None);
			for(int i = 0; i < Data.Length;) {
				rect.Data.Write(Data, i, 4 * W);
				i+= 4*W;
				rect.Data.Position = rect.Data.Position - 4 * W;
				rect.Data.Position += rect.Pitch;
			}
			t.UnlockRectangle(0);

The hopefully last minor bugs are that my z-position isnt applied correctly and the textures are still a bit blurry.
The small album art should be rendered over the big one. It is working fine in OpenGL, but z-Positions can go beyond 1.0f in OpenGL. If I draw my z-Positions with values over 1f they wont show up. I am currently setting any positions over 1f to 1f which creates this bug i think.
The other thing is that the textures are not that good as in OpenGL. I experimented with some TextureFilters ending up using a linear filter, which is still not too fine. In OpenGL i am using MipMaps to have smooth textures. Can I do the same in DirectX?

EDIT: I found out that DirectX is only capable of Z-Positions between 0 and 1. So I normed the Z-Positions to fit in. The positions are calculated properly but my screen is just white now. Do I need to set a Flag to enable Z-Positions?

#2xDarkice

Posted 09 January 2012 - 09:32 AM

I am not recreating the texture each frame. I keep all textures stored in a List and they can be updated using my UpdateTexture methods. The textures are drawn in my DrawTexture methods.

Your post really helped me out. Instead of writing the data directly into the stream i am now doing this which works like a charm:

DataRectangle rect = t.LockRectangle(0, LockFlags.None);
			for(int i = 0; i < Data.Length;) {
				rect.Data.Write(Data, i, 4 * W);
				i+= 4*W;
				rect.Data.Position = rect.Data.Position - 4 * W;
				rect.Data.Position += rect.Pitch;
			}
			t.UnlockRectangle(0);

The hopefully last minor bugs are that my z-position isnt applied correctly and the textures are still a bit blurry.
The small album art should be rendered over the big one. It is working fine in OpenGL, but z-Positions can go beyond 1.0f in OpenGL. If I draw my z-Positions with values over 1f they wont show up. I am currently setting any positions over 1f to 1f which creates this bug i think.
The other thing is that the textures are not that good as in OpenGL. I experimented with some TextureFilters ending up using a linear filter, which is still not too fine. In OpenGL i am using MipMaps to have smooth textures. Can I do the same in DirectX?

#1xDarkice

Posted 09 January 2012 - 09:31 AM

I am not recreating the texture each frame. I keep all textures stored in a List and they can be updated using my UpdateTexture methods. The textures are drawn in my DrawTexture methods.

Your post really helped me out. Instead of writing the data directly into the stream i am now doing this which works like a charm:

    DataRectangle rect = t.LockRectangle(0, LockFlags.None);
		    for(int i = 0; i < Data.Length;) {
			    rect.Data.Write(Data, i, 4 * W);
			    i+= 4*W;
			    rect.Data.Position = rect.Data.Position - 4 * W;
			    rect.Data.Position += rect.Pitch;
		    }
		    t.UnlockRectangle(0);

The hopefully last minor bugs are that my z-position isnt applied correctly and the textures are still a bit blurry.
The small album art should be rendered over the big one. It is working fine in OpenGL, but z-Positions can go beyond 1.0f in OpenGL. If I draw my z-Positions with values over 1f they wont show up. I am currently setting any positions over 1f to 1f which creates this bug i think.
The other thing is that the textures are not that good as in OpenGL. I experimented with some TextureFilters ending up using a linear filter, which is still not too fine. In OpenGL i am using MipMaps to have smooth textures. Can I do the same in DirectX?

PARTNERS