   Bumpmap help please...
  Hey guys, here's an (hopefully) easy one for ya.I'm experimenting with bumpmapping for my Direct3D quad engine (it's a 2D engine using D3D primitives), and you can see that I've got it 'sort of' working...  The thing is, I can't find a whole lot of resources and tutorials for 2D bumpmapping.My problem is what you see in the screenshot...  If you look at it, it's pretty easy to tell there's four bumpmap-textured primitives by the defined light gradiant between them.  But what I want is a single, smoothly-lit green square with eight 'pyramids' on it.  I found a way to do simple bumpmapping by applying my light info to the whole primitive, but I can't figure out how to get rid of the light gradiant 'seam' between the quads.  How do I make the lighting happen 'seamlessly' across multiple quads?I dunno how to explain how I've gotten this far without cluttering up this post with a ton of code, so here's my experimental source code so you can compile it and see it in action.  It's a VisualC++.net project that was coded using the October version of the DirectX9c SDK.Bumpmap CPP Project (240k)Thanks in advance for the help!   
  One thing that might help us get a better understanding for what you're doing would be if you could explain the basic steps you're performing to do your bumpmapping.For example, in 3D bumpmapping, the basic steps go something like this.Load/Generate tangent-space bumpmapsConvert lighting parameters to model spaceSet materials, textures, bumpmap texture, etc...Render the data - in vertex shader . . convert lighting parameters to tangent space - in pixel shader . . fetch data from bumpmap . . perform standard lighting computations and output result.The main difficulty most people have with bumpmapping is making sure all of the data is in the appropriate space.  If you give a bit of detail as to how you're doing your bumpmapping, perhaps we could point you in the right direction.neneboricua   ;  I'm not too sure how to explain what steps I'm taking to get the bumpmap to appear, as I've gleaned what little I know from code snippits I've found here and there on the internet.  None of those websites went into detail exactly how the bumpmapping occured, so I got it to work using 'trial-and-error' and still don't know how it works.If you download my code, you'll see pretty quickly how I've gotten bumpmapping to work (the code's based on Microsoft's 'vertices' tutorial).But I guess what's going on is I'm loading my primary texture (a plain green .tga file) and a 'heightmap' texture (greyscale jpeg).  Then, I turn the heightmap texture into a 'normalmap'.  Next, during the 'render' loop, I calculate a light location and then turn that into a color value.  The color value is passed to the rendering stage, where it's applied to the normalmap texture using 'g_pd3dDevice->SetRenderState(D3DRS_TEXTUREFACTOR, dwFactor)' to create a bumpmap.  Finally, I overlay my primary texture on top of this bumpmap texture.  That method works fine for one quad, but it shows 'seams' when two or more quads are next to each other.Rather than using the above method to create a bumpmap, is there a way to calculate my bumpmap info using the lighting (color) of the quad's vertices?  My method cannot be used for colored lights, and I think it would be cool to be able to support colored lighting in my game engine.   ;  Sorry, but I don't really have enough time to look through someone else's code these days.  But from your description, it doesn't seem like you're doing bumpmapping at all.  It seems like you're doing some kind of blend between the bumpmap and the regular texture.A few questions for you.  What do you mean by this?Quote:DookieNext, during the 'render' loop, I calculate a light location and then turn that into a color value.How do you turn the location of a light into a color?  Is this location in 3D or 2D?Quote:DookieThe color value is passed to the rendering stage, where it's applied to the normalmap texture using 'g_pd3dDevice->SetRenderState(D3DRS_TEXTUREFACTOR, dwFactor)' to create a bumpmap.  Finally, I overlay my primary texture on top of this bumpmap texture.So you convert the location of the light into a color, and set this color as the TextureFactor?  This renderstate is meant to set a particular color value to use during blending.  You select this color value by calling SetSamplerState, specifying an blending operation, and using TFactor to indicate the TextureFactor should be used.  So you are basically multiplying this color value by the bumpmap value and then by the main texture...This isn't how bumpmapping works.  The "bumpiness" in bumpmapping is achieved by performing a dot product between a vector pointing to the light source and a value stored in the bumpmap.  It seems what you're doing here is some kind of blending of your two texture maps.Perhaps you can start a topic about how to do bumpmapping in 2D?  I've always thought that bumpmapping was a 3D concept but perhaps there is some way to fake it.neneboricua   