Milo got a question.

Starshatter: The Gathering Storm extends the classic space sim by combining fighter and starship combat in a single dynamic campaign game.
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

Milo got a question.

Post by DamoclesX »

Are you planning to add bump map support anytime soon(say yes), or within say the next 1-4 months(say 1-4hours):)?

I know it might be a bit, since there is still the magic problem of not supporting spec and glow on the same surface.

reason I ask is if so, I will build any future ships with that in mind:) and not have to redo oh so many damn ships at once LOL.

plus bumps are a more work then simple specs
Jason Blaz
Way to much to list here!
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

Here is bump mapping for those who have not seen it.

The first model has it, notice how it seems like there are panels, and the bolts are round.. check out the detail on the engines also, it looks like it has depth

the second has none.

Its also more then simple depth, bump mapping adjusts to lighting, so unlike faking depth in photoshop bumpmapped depth will always look "right" according to scene lighting

http://members.shaw.ca/DamoclesX/1.jpg

http://members.shaw.ca/DamoclesX/2.jpg
Jason Blaz
Way to much to list here!
Werewolf
Posts: 49
Joined: Fri Sep 17, 2004 12:52 pm
Contact:

RE: Milo got a question.

Post by Werewolf »

To be honest, what would make even more sense would be for Milo to port the rendering to a shader-capable API. It doesn't have to be OpenGL 2, though that would of course be the best thing that could happen. It would be totally awesome if mod authors could just define their own shaders per material, and use that on their models. Then you'd be able to add bumpmapping on your own with just a few minutes of work.
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

I agree, if somebody can define it for me lol

I"m afraid any directx programming skills I have are back in the days of dx5 :(

but, could you look into what would be needed for that? and post it here? might help milo decide

that would be nice cause we could add enviro mapping as well... and displacment mapping would be great for astroids.

I wonder if that geomesh thing is possible...... where the mesh can be dynamically deformed to simulate damage

you know now that I think of it opengl would be the best... I run il2 in opengl and I get about 30fps more on the highest detail settings, a setting that the directx version does not even have!!!

Btw milo, this would also greatly improve your own stock ships, think zolon ships but with real 3d scales on their skin, to do that with models would take 10,000 polys easy, but with bumps it would take 1 256x256 map.

Hell..... you could I imagine animate that map to animate make about 16 or 32 bump maps, each a transition and it would appear if the scales were moving up and down... damn thats freaky actually.... I wonder how you could setup the maps to transition smoothly...

I wonder how long it is before milo has me shoot for suggesting so much more work for him?(locks doors)
Jason Blaz
Way to much to list here!
John DiCamillo
Posts: 360
Joined: Sat Feb 28, 2004 7:02 am
Contact:

RE: Milo got a question.

Post by John DiCamillo »

As I said, I'm not really ready to talk about what I may or may not be working on at home. I can say that the kinds of features you are talking about require a complete re-write of the graphics engine. Starshatter uses a number of DirectDraw 2D graphics features that were removed in DX8 or DX9.

However, I do have a question related to your question. [:)] Would it better to use bump maps or normal maps? Do most mod-type people have the tools needed to generate normal maps? Come to think of it, I'm not sure how I would be able to create normal maps even for testing purposes...
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

Wow, normal maps are pretty damn new.

I have looked into them but never actually used them, I figured they were too new lol

Here is a good how to with cinama4d about them http://members.shaw.ca/jimht03/normal.html

I Think doom 3 uses normal maps but I"m not sure.

as for making them, I will look into it tonight, see what I can come up with.
Jason Blaz
Way to much to list here!
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

Still working on it

I got the tools I need

just a quick heads up, I wouldnt worry about modders not having the tools, you just need 3dmax6 and the normal mapper tool you need is a free download plugin

ITs been my experience modders always seem to find the tools they need, even if they cost 6000$[&:]
Anyways, just trying some simple objects first, then I"m gonna do a EA Nova, see what I can do with details, I got a 150,000 poly model I made a long time ago.
Jason Blaz
Way to much to list here!
User avatar
Incendiary Lemon
Posts: 137
Joined: Wed Mar 31, 2004 3:54 pm

RE: Milo got a question.

Post by Incendiary Lemon »

The tools are fairly easy to pickup, either as shipped plugin in your modeling program or off the NVidia and ATI websites. Making the high poly models, I suspect that the average moder would love to go off and do that 300,000 face creature if they haven't already.
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

its a lot more annoying then that

the damn tool wont export over 512x512 textures, so that is really screwing everything up

its also bent towards more non 90degree angle stuff, so i"m not sure how this will work with ships, its AWSOME for anything organic or anything involving people, but I"m almost thinking straight bump maps would be better for anything mechanical, but we will see

im slaping together a high ppoly model and I"m gonna see what I can do with it
Jason Blaz
Way to much to list here!
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

Okay here is the deal

Henry and I worked on this for some long hours, and really got nowhere.

I can get it to work on a sphere, but if you do ANYTHING to that sphere, then its just junk, it will crash the program the second you try to make the map.

Now normal maps can be made from bump maps, but honestly, whats the point. To say it was annoying is beyond being nice. You have to drop out of max, do stuff at the command line, you cant view the final product in max you need an external viewer, it would be next to impossible to may ANY kind of maps worth it unless you had max, or were very good at photoshop.

Frankly in my opinion they are not worth it if bump maps are possible in any way or if an engine re-write is planned.

IF this is something you can add without to much work.... and it seems like bumps would be major work, then I will keep trying with Henry and to come up with SOME sort of easy solution that makes sence to everybody else

HOwever right now

Its REALLY unfriendly, I dont see any way at this point I could use any of the ships I made with this process, I could draw them by hand, like you do with bumps... and that might possibly work, but I'm not even sure on that, if it did it would be using them like a glorfied bump mapper basically.

Mind you, -IF- that method works, and IF its easy to be added to starshatter without tons of work, it might be a good stop-gap solution, but it is going to need that 1 texture per surface limit removed from magic, your going to need spec maps, color maps, lum maps, and now this map all on the same surface, that alone cant be nice to think about lol.

But as for taking some uber super cool character or ship, using max to generate a map applying that to a low poly model and getting it in starshatter using the restrictions of magic(good luck selecting the right faces you need on any of my b5 models, try it, I dare ya:) ) Id say no way, not until a LOT better bunch of tools come out for it.

Even if I could get around those magic problems, the program itself in max is to touchy, we barly get anything done if anything is done to that low poyl sphere.
Tomorrow I will experiment with trying to converting bump maps to normal maps and use them that way.

The reason its used in such games as doom3 and swg is they have in house tools that make all this a joke
Jason Blaz
Way to much to list here!
John DiCamillo
Posts: 360
Joined: Sat Feb 28, 2004 7:02 am
Contact:

RE: Milo got a question.

Post by John DiCamillo »

OK, again bearing in mind that any such changes require a complete rewrite of the graphics engine into DX9, as well as an almost complete rewrite of Magic to support more advanced material properties...

Bump maps are almost certainly easier to implement in DX9 than normal maps would be. Actually, I think that bump maps are supported by the fixed-function pipeline in DX8 and DX9, so no custom shaders should be required. It may still be desirable to write a custom pixel shader just to reduce the number of passes. On the other hand, I'm not sure how many graphics cards can do more than two texture stages in a single rendering pass anyways.

So, if I understand you correctly, creating normal maps essentially requires creating super-high poly models in Max or LightWave, and then using some sort of tool to render patches of the model into a normal map texture. As an alternative, I would need to create a tool that converts a monochrome bump map image into an equivalent normal map by computing partial derivatives in the u and v directions for each bump map texel.

Hmmn.
User avatar
Pheonix Starflare
Posts: 254
Joined: Wed Mar 31, 2004 8:20 pm
Location: Boston, MA, USA

RE: Milo got a question.

Post by Pheonix Starflare »

As a comment from somone with no real expertise in graphics/coding...

Damo pointed out earlier that normal mapping can make things look awesome...like zombies and demons. However, I'm not sure that normal mapping, as opposed to the apparently much easier bump mapping, would provide much of a benefit to space ship models. Certainly there is the opportunity to make organic/organic looking objects in SS or a mod for SS.

I am curious, however, what is the actual difference between normal and bump mapping? Could normal mapping produce a more drastic effect? Are they essentially the same thing, or is there a very big difference I'm not aware of?
"An optimist sees a glass half full, a pessimist sees a glass half empty and an engineer sees a glass thats twice as big as it has to be."

"What do you get when you cross a chicken and and elephant? Chicken elephant sine(theta)"
Werewolf
Posts: 49
Joined: Fri Sep 17, 2004 12:52 pm
Contact:

RE: Milo got a question.

Post by Werewolf »

Instead of writing, I'm quoting a quick rundown of the differences (Yeah I know I'm lazy ;) )
In 3D computer graphics, normal mapping is an application of the technique known as bump mapping. Bump mapping is a technique where at each pixel, a perturbation to the surface normal of the object being rendered is looked up in a texture map and applied before the illumination calculation is done (see, for instance, Phong shading.) The result is a richer, more detailed surface representation that more closely resembles the details inherent in the natural world. While bump mapping perturbs the existing normal (the way the surface is facing) of a model, normal mapping replaces the normal entirely. Whereas a bump map changes normal vectors' magnitudes, a normal map changes normal vectors' magnitudes and directions.
John DiCamillo
Posts: 360
Joined: Sat Feb 28, 2004 7:02 am
Contact:

RE: Milo got a question.

Post by John DiCamillo »

Interesting question, Phoenix. The answer depends on the context in which you ask the question.

Bump mapping was originally invented by Jim Blinn for use in high-end CGI ray tracing systems. In those systems, the rasterizer steps through the pixels of the frame buffer for each pixel, it must answer the question "What color should be drawn here?" A ray tracer does this by computing an eye-ray from the camera to the precise point on the object in the scene that is visible at that point on this display. Then the ray-tracer figures out how much light is falling on the surface at that point and what color the surface is, and it multiplies all that together and produces the final color of the screen pixel.

Part of determining how much light is reflected by a surface involves determining the angle between the incident light and the normal vector of the surface. If the surface normal is pointed directly at the light source, it will reflect a lot of light; if it is pointed in the opposite direction, it will reflect none at all. Usually, the surface normal is computed from the plane equation of the polygon, or from the parametric equation that describes a curved surface.

Blinn realized that if you were to perturb the surface normals at various points within the confines of a single polygon with a bump map, it would give the appearance of being made up of many tiny polygons, without the cost of actually modeling all of them individually. The key point of "real" bump mapping is that it adds a vector to the surface normal at each point and uses the new normal to compute the diffuse and specular components of the illumination equation.

Enter DirectX Gaming.

All of the above stuff is rather costly to compute because of all the vector math needed to perturb the surface normal for the pixel-accurate lighting equation. Square roots all over the place. Until recently, that was far beyond the capacity of most consumer graphics hardware.

Instead, DirectX 7 introduced a hack and called it "bump mapping". In this hack, a bump map texture is created with U and V channels that are roughly analogous to the partial derivatives of the bump map in the U and V directions of tangent space. In real bump mapping, these components would be used to compute a perturbed normal for the illumination equation. In the pseudo environment bump mapping scheme provided by DX7+, the U and V values of the bump map are used to index an "environment map" that serves the same purpose as the illumination equation - it determines the amount of light reflected by a surface normal in a given direction. Note that this is not really the same as the reflective environment maps used to create the chrome effect in cube mapping. The environment map for pseudo bump mapping is usually a gradient from white to black.

Once the U,V bump map values have indexed a texel in the environment map, that color is added to the current color in the frame buffer. Adding the colors produces a plasticky specular bump map surface. (It's plasticky because the color of the reflected light is always white, which is a characteristic of plastics and other insulators. Metallic surfaces and other conductors tend to have specular highlights that are the same color as the basic metal.) As an alternative to the specular additive approach, you can also program the pipeline to modulate the underlying diffuse color by the bump value, and then add specular highlights in a separate pass.

The point of this long-winded dissertation is that DirectX "bump mapping" is an approximation of the real thing, and not a very good one at that.

The idea behind "normal mapping" is to create a texture in which the R,G,B values of each texel are really the nx,ny,nz components of the surface normal vector in tangent space. Then you write a custom pixel shader that transforms the surface normal into the global coordinate system and actually compute the diffuse and specular colors using a real illumination equation in the programmable GPU of the graphics card. As you can see, "normal mapping" is really what "bump mapping" was originally intended to be. But since people had been using the word "bump mapping" to mean something else for several years, a new term had to be chosen now that real bump mapping was actually possible in real time.

Hope this helps...
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

Milo sure knows his stuff,

Okay, I Thought about it for a while, now, I think its a 2 edged sword here, while there is no doubt normal maps would look better once they were working right, in my opinion at this current time there is no good way to build them. ATI's tool is usless at best, I could get it to work for a sphere, but if I did anything to that sphere, then it would crash the program, I THINK it has to do with not having any uvw unwrapped materials overlapping, but I"m not sure, I am going to investigate it further.

Since normals work like bumps, IF an easy way to build normals could be found they would be the better choice in a way, but I"m not sure if they would be the best overall choice.

I think it really comes down to cost vs time, how long is this going to take? will adding normals add 3 more months work over bumps? Is it going to end up being very difficult to use?

Bumps, are simple, realllly simple, and they do look really good, x2 I Think ruined bumps in a lot of peoples eyes because they simply just didnt know how to use them, but use subtly they add great effects.

Since you are at thinking of this, have you looked into detail maps? I cant give you much info because I dont know myself, but I do remeber somebody suggesting that they would be a good addition, somehow adding more detail at closer range, I will look up on it.

As Pheonix Starflare pointed out there may not be THAT much difference, because it still comes down to the modeler needs the skills to make a GOOD looking organic ship, then another low poly organic ship of the same dimensions, it may sound easy, but I dont like doing it, once you get into meshsmoothing and organics I find you have a hard time controlling the geometry.

The one thing that normals kill bumps IS characters tho, plain and simple if ss was ever going for some reason to use people/animals I would suggest normals because they just really blow your mind.

One more question, is it by design that it is easyer for you to re-write it into directx9? and not something like opengl? I am a big fan of opengl it runs a -lot- faster for everything I have ever used it for, bear in mind I really dont have much grass roots knowledge on the differences between dx9 and opengl.

Finally, I will look some more at normals and bumps this week adn weekend, and Henry seems pretty into it so maby he can program some sort of tool. I spent about 3 hours debugging the maxscript for that ati tool yesterday... I cant belive they would reelase a tool with bugs that CRASHED the program.......

One kick in the teeth here.. nvidia does also have a normal tool, and it seemed to work, HOWEVER ati and nvidia use different colors for different heights or directions I guess!!! so it came out all screwed up on my ati card:(
Jason Blaz
Way to much to list here!
Werewolf
Posts: 49
Joined: Fri Sep 17, 2004 12:52 pm
Contact:

RE: Milo got a question.

Post by Werewolf »

@Milo: Let's not forget the fact that it wasn't DirectX's fault that bumpmapping was done with "a hack", as you called it. Matrox was one of the first card vendors to support Bumpmapping, and the technique and limitations were the same in OpenGL and DirectX. As you stated, the early GPUs didn't have enough power to do normal calculations on a per-pixel level, and we're all just beginning to play with the possibilities of today's hardware.

The problem is that you have to be real good in math to be good at shaders - unless you're working like Valve and just copy and paste example shaders into your beefed-up Quake2-engine [;)]

Bumpmapping is nice because it isn't really expensive on today's hardware, yet it can add a lot of detail without much work. Add shiny-maps, dynamic lighting and glow buffers, and you can do some impressive visuals without too much additional work. Shinymaps can be a bitch to get right on complex textures though [:@]
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

never used shinymaps

glows are good, glows like you see in bridgecommander, they really add some sweet effects, I fear however we are loading stuff up that would take very long to implement for milo.


Just wondering tho, if this engine was ported to directx9, wouldnt that really boost the fps since its using features our current cards are designed for?
Jason Blaz
Way to much to list here!
Deepblue
Posts: 14
Joined: Sat Apr 10, 2004 8:44 pm

RE: Milo got a question.

Post by Deepblue »

If your going to do glows, just make sure they include light blooming, otherwise they aren't all that great.
John DiCamillo
Posts: 360
Joined: Sat Feb 28, 2004 7:02 am
Contact:

RE: Milo got a question.

Post by John DiCamillo »

ORIGINAL: Deepblue

If your going to do glows, just make sure they include light blooming, otherwise they aren't all that great.
Do you have a sample screenshot of the light blooming effect you are requesting?
User avatar
DamoclesX
Posts: 872
Joined: Thu Apr 08, 2004 10:50 pm
Location: Canada

RE: Milo got a question.

Post by DamoclesX »

I dunno about blooming, but glows in a sense.. shouldnt be that hard(if you compare to say bumps with the magic edits and all) if you do the glows like bridgecommander, all the engine did was "glow" any lum area, so basically you just apply the glows to any areas that normally are luminated

here is screens

http://www.bridgecommander.com/visuals/index.htm

you might have to scroll through them to get a good example

oh, and that sun... ya.. that would look REALLY cool in ss, but I have -no- idea how they did it

you will also notice the dynamic damage the ships have, but, I dont even know where to begin to describe that, I know for them it was not that complex to do, somehow they broke the mesh down to a tree with nodes and leafs, it also used NIF format for the models

franky, dynamic damage like that is not that great in my books, you could do stuipid things like cut the ship all around the critical stations, wait for it to repair and have like a flying block that worked perfecty, I"m more for surface scarring, I love that, hit any area of a ship and a black scare appears, very cool

with their damage, I once SKINNED a ship, ripped off all the external skin, and did it slow enough that I let the ship keep repairing, eventually it had no freaking skin and worked 100%, not cool
Jason Blaz
Way to much to list here!
Post Reply

Return to “Starshatter: The Gathering Storm”