BlockLeftTop, PRELOAD BlockLeftBottom, PRELOAD BlockLeftStretch, PRELOAD BlockTop, PRELOAD BlockBottom, PRELOAD BlockStretch, PRELOAD BlockRightTop, PRELOAD BlockRightBottom, PRELOAD BlockRightStretch, PRELOAD
Latest Game

NormalMapCompressor v1.4

by Benjamin Nitschke 12. February 2006 20:37
As announced in my last post I've updated NormalMapCompressor to Managed DirectX for .NET 2.0 with help of the February 2006 DirectX SDK.

You can download the whole thing by clicking on the image on the right or with help of these 2 links:

Couple of notes: The GraphicBuffer (formally GraphicStream or just accessing data with .Lock methods directly) is really strange. Writing does always work, but when reading data all kinds of things have to be checked by yourself. All the data in GraphicBuffer (Data sizes, Elements, Data lengths, etc.) are always 0, so they don't help you at all. Doing foreach is possible, but doesn't work either. Direcly accessing with help of the indexer works fine (but you have to copy all data over to a temp. variable and then copy it back). I found that out the hard way by trying everything out until it worked finally. Here is some code:

int numOfVertices = someMesh.VertexCount;
GraphicsBuffer<TangentVertex> verts =
  someMesh.LockVertexBuffer<TangentVertex>(LockFlags.None);
for (int i = 0; i < numOfVertices; i++)
{
  // Get vertex data
  TangentVertex vert = verts[i];
                
  // Change texture coordinates
  vert.u = (float)(Math.Atan2(
    -vert.pos.X, vert.pos.Z) / Math.PI);
  vert.v = 0.8f *
    (float)(0.5f - vert.pos.Y / 2.0f);

  // Set changed vertex
  verts[i] = vert;
} // foreach (vert)

Same problems for converting the texture, but I used a totally different approach there (converting everything to a bitmap stream and than creating a new texture with that). Other than that the initial conversion took less than a hour, couple of renames and thats it.

I don't get the point why VS 2005 puts the Microsoft.DirectX.dll (MDX 2.0) into the debug and release directories. First I thought: "Cool, maybe this works now even with older DirectX versions". But after testing on my brothers computer nothing worked except when DirectX Feb2006 was installed. I adjusted the installer to that.

So if you can live without the missing MDX 2.0 help (for example if you are already experienced enough in MDX 1.1), it is really an option with DX Feb2006. All missing methods from the last betas were added and most problems are resolved. I think it looks pretty good and I will use MDX 2.0 directly in future projects.

Comments


1/10/2010 2:39:28 PM #

Nice resource. rss feed added

1 hour payday loans | Reply



4/1/2010 11:06:48 AM #

Only those who dare to fail greatly can ever achieve greatly.

body detox | Reply



4/1/2010 11:17:16 AM #

It is common sense to take a method and try it. If it fails, admit it frankly and try another. But above all, try something.

Natural Colon Cleansing | Reply



4/26/2010 7:41:47 PM #

Stand up to your obstacles and do something about them. You will find that they haven't half the strength you think they have.

pay day loans | Reply



4/26/2010 7:48:36 PM #

I never will understand all the good that a simple smile can accomplish.

faxless payday loans | Reply



4/28/2010 3:48:54 AM #

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Rapidshare | Reply



5/4/2010 7:19:03 PM #

As announced in my last post I've updated NormalMapCompressor to Managed DirectX for . NET 2. 0 with help of the February 2006 DirectX SDK.

Rapidshare Search engine | Reply


Add comment




biuquote
  • Comment
  • Preview
Loading



Disclaimer: The opinions expressed in this blog are own personal opinions and do not represent the companies view.
© 2000-2010 exDream GmbH & MobileBits GmbH. All rights reserved. Legal/Impressum

Recent Games

Fireburst

ArenaWars Reloaded

Jobs @ exDream

Current Poll

Do you know what the Delta Engine is?



Show Results Poll Archive

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

Blogs

Download OPML file OPML