Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Normal and Heightmaps

Author
Message
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 13th Feb 2009 14:14 Edited at: 13th Feb 2009 14:15
Im working on a image program and it takes a standard 2d image and coverts it into the above listed, ready to use in game. The normal maps it produces are top quality. They Look excellent in game.

Attached is a normal map produced with this program.

All comments are welcome..Its not finished yet, but its very close.

Also, I\'ve put in a very easy to use menu system with open/close dialog box\'s and windows.

Also this is written in C++ with directx, Latest SDK. Thank you.

Attachments

Login to view attachments
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 13th Feb 2009 14:28 Edited at: 14th Feb 2009 14:34
<Snip1>
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 13th Feb 2009 14:34 Edited at: 13th Feb 2009 14:36
LOL maybe, but then I thought that we could post any WIP here.

Who cares what language it was written in? I don't think that TGC really cares what language it was written in. Maybe nobody here wants something like this and I'm just wasting my time.

Guess I'll just find out if it gets locked.

edit: Did you just want to come here to tell me the "rules" or do you have something to say about my program thats legit? Like perhaps, how does the normal map look. Do you have a demo version? Thanks for the post though at least I know you read it.
Tom J
18
Years of Service
User Offline
Joined: 4th Aug 2005
Location: Essex, England
Posted: 13th Feb 2009 15:19
That normal map looks nice good work!

GDT DEBATES - GO AND CONTRIBUTE [href]http://forum.thegamecreators.com/?m=forum_view&t=142248&b=19[href]
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 13th Feb 2009 16:36 Edited at: 14th Feb 2009 14:35
<Snip2>
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 13th Feb 2009 21:50
I dont mean to sound like a ***** but what about projects like Vickys, Witchgate???? That clearly isnt DBP and Was Clearly made before RealmCrafter was for sale on TCG website.

Thank you Tom J.
Alucard94
16
Years of Service
User Offline
Joined: 9th Jul 2007
Location: Stockholm, Sweden.
Posted: 13th Feb 2009 22:53
Quote: "That clearly isnt DBP and Was Clearly made before RealmCrafter was for sale on TCG website."

But it was posted (On this forum) after RC was for sale on the homepage.


Alucard94, the member of the future of the past.
Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 13th Feb 2009 22:59
I would like to see a program like this written entirely in dbp, now that would be very usefull for normal mapping entire scenes in games and stuff without having to make all of the normal maps beforehand.

I might give it a shot

in Austrlia, there is a really red sun, u got a red sun in sky too?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Feb 2009 23:51
Quote: "I would like to see a program like this written entirely in dbp"


If you're really desperate I'll post one tomorrow - I've been using it for some time.

Quote: "Also, I\'ve put in a very easy to use menu system with open/close dialog box\'s and windows."


That's why I haven't posted mine - it doesn't do that yet (and the code needs to be tidied up a lot).

But it works for me.

Quote: "This board is for DB and DBP WIPs."


I'm sure it isn't and this thread is perfectly acceptable. [But, having said that, I couldn't find any definitive statement one way or the other in the obvious thread - yet I'm sure I saw something along those lines some time back. Obviously imagined it. ]
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 14th Feb 2009 02:25
i didn't read the hole thread but about the person saying he isn't supposed to post here its just in a wip board not a dbc/dbp board its anyones work in progress stuff
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 14th Feb 2009 02:50
As this is a tool for the community(I assume) I believe it's fine. However the above poster is completely wrong else we could just make WIP topics about OGRE projects, HL2 mods and other things completely unrelated to TGC which would serve no purpose but to dilute projects that are actually related to this community.

Lucifer
18
Years of Service
User Offline
Joined: 26th Dec 2005
Location:
Posted: 14th Feb 2009 04:00
Quote: "If you're really desperate I'll post one tomorrow - I've been using it for some time"


niice! that'd be totally awesome could you post it for me? If my attempts to make my own code failed i could sure use something like this

in Austrlia, there is a really red sun, u got a red sun in sky too?
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 14th Feb 2009 06:26
DC you are correct.
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 14th Feb 2009 07:47
This WIP is allowed for the reason that Dark Coder stated. DBpro TPC plugins are written in C++, and they are allowed. This is a tool for the community and welcome here.

Now, let's bring this back on topic.

Good luck with this David. I have written something similar for my 3D Character Maker. I'm sure a lot of people would appreciate a polished tool to do this.


a.k.a WOLF!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Feb 2009 23:58
Lucifer

Demo attached. It produces a normal map and a height map from your input image. You may need to play with the "smooth" parameter in the main function - I usually use 1 or 2.

The program prompts for input file name, normal map name and height map name (you'll need to include valid extenders such as bmp, jpg, png, dds, etc).

It also asks for a percentage for the vertical scale. This refers to how the height map is to be interpreted, i.e. the difference between the highest bump and lowest valley is a percentage of the image width. Percentages in the range 1 to 5 usually work well.

When it's finished processing and saving the images it'll use a shader to display a bump mapped cube.

I've included two test images for you to try.

This is just a rough version intended for my own use - but feel free to use it as you wish.

Attachments

Login to view attachments
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 19th Feb 2009 14:53
Thanks gg for the dbp app that anyone can integrate into their application...

I would like to know though if anyone here would like to request any features that I can put into this program. I have the vision of this doing more than just normal and heightmaps,,,I have beta v1 done and will be uploading it soon for people to test out.

I can add support for alot of image based manipulation techniques if the community wants it. Just let me know

Thank you.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 19th Feb 2009 15:55
Quote: "I would like to know though if anyone here would like to request any features that I can put into this program."


I use XNormal which comes with many useful tools, so assuming you implement stuff they do then you could expand on them. One thing that's annoyed me with most of these tools is that I don't recall one where you can independently specify which axis to tile. XNormal only allows you to tile on both axis(or none) which is annoying for certain textures, but it can be manually corrected.

Another thing that XNormal doesn't have is a way to sample the source multiple times for the final normal, i.e. fine, medium and large details, normally it's just on a per-pixel basis which makes the normal look generally flat showing only the high frequency detail, but again this can be done manually.

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Feb 2009 16:23
One thing that I've just done with a similar project is I load up a model and scan it with PICK OBJECT, it works really well and is easy. I'm using this to make dot3 normal mapped sprites, so you'd have a complex mesh and then render that as a normal map, add in a base texture and you have a sprite that can react to lighting as if it was 3D. After the sprite gets a texture and normal map and a per pixel lighting shader, it looks much better than the original mesh.

I think that would be a great addition, because a lot of the time we are making normal maps for things like brick textures - I'd much rather use Rhino3D and nurbs to mould a 3D mesh then use that instead of a height map. It's not ideal for C++, but maybe something you could consider as a useful option for a future version.


Health, Ammo, and bacon and eggs!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Feb 2009 12:35
Van B

Quote: "After the sprite gets a texture and normal map and a per pixel lighting shader, it looks much better than the original mesh."


I've obviously missed something important here. How do you apply a shader to a sprite?
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Feb 2009 13:31
Ahh, probably shouldn't have referred to it as a sprite. It's a plain, or rather 2 plains as normal mapped plains seem to hate transparency. I plan to use these plains as if they were sprites.

I am planning on trying a relief mapper as well, as a heightmap image is created too - think that would make a lot of difference?, like a relief shader vs a normal shader when dealing with psuedo 2D?.


Health, Ammo, and bacon and eggs!
Monk
15
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 20th Feb 2009 15:30
What exactly are normal maps and normals? and what do they get used for?

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Feb 2009 15:38 Edited at: 20th Feb 2009 15:38
Normal maps are textures that use the red green and blue elements in each pixel to determine the normal direction of the surface. Blue is Z, red is X and green is Y. The normals are calculated by sampling heights from the texture or model and working out the angle that the point should be pointing in. This is then affected depending on the light and camera direction, then the pixel changed to suit the normal map. Each vertex has it's own normal, which does the same thing, but the cool part is taking a high detail mesh and making a normal map for it, then applying the normal map to a lower detail mesh and getting all that detail back, albeit as a normal map.

Normal maps are also used in refraction effects and water effects, they are very useful things but do take a bit of learning.


Health, Ammo, and bacon and eggs!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Feb 2009 19:23
Quote: "It's a plain, or rather 2 plains as normal mapped plains seem to hate transparency."


I don't think there is any reason why you can't have normal mapped plains with transparency. You'll need to edit the shader a bit to make sure it renders the alpha correctly and use the usual transparency commands in DBPro, and that should be all. If you post a simple example I could probably fix the shader for you.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Feb 2009 19:30
Nah, I can get transparency working, but the normal map is fully transparent, so I use 2 plains. I'll have another go at getting it working with 1 plain, then maybe you could help me fix it if you have the time.


Health, Ammo, and bacon and eggs!
Monk
15
Years of Service
User Offline
Joined: 25th Sep 2008
Location: Standing in the snow =D
Posted: 20th Feb 2009 19:43
Cheers Van B for the explanation, it makes more sense now

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Feb 2009 20:47
Quote: "Nah, I can get transparency working, but the normal map is fully transparent, so I use 2 plains. I'll have another go at getting it working with 1 plain, then maybe you could help me fix it if you have the time."


Try the attached demo. The shader is essentially the same as the one included a few posts back - with very minor changes for alpha mapping. (The other changes are just to make the shader conform more to my current style. )

It's not an exciting alpha demo - you should be able to see the red background through the chinks in the "chain mail". The alpha is assumed to be in the base texture, but a simple change would allow you to read it from the normal map instead. Entirely up to you really.

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 21st Feb 2009 00:40
Thanks for that GG, perfect .


Health, Ammo, and bacon and eggs!
sindore
19
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 23rd Feb 2009 16:27
had to think about what it would not load .jpeg files at 1st but now I go it to work, this is just what I've bin looking for, thanks green gandalf.

soul sucking devils, twisted body of the damed, slivering slim drips from every poor, sin licking at your ears, and the smell stinging your eyes, and if you don't like it, get out of my kitchen!
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 26th Feb 2009 18:27 Edited at: 26th Feb 2009 18:28
Well I've add a bunch of stuff to the program now and version 1.0 is almost done. I've included adjustments so you can adjust the way the normals look and I've also added inverted normals. (the normals point the opposite direction).

Also fixed a number of bugs and now any size image can be used. So no matter the dimensions it will work and wont crash

Login to post a reply

Server time is: 2024-04-25 13:35:13
Your offset time is: 2024-04-25 13:35:13