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.

Newcomers DBPro Corner / Bump Mapping for new people!

Author
Message
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 10th Aug 2007 20:09
Hey all,

After a few days of just playing around with things, i have learned how to make realistic looking Shininess on surfaces by use of Bump Maps!

Heres a little tutorial on how to do this, on a note to people who do not know how to do this, this type of thing is fairly easy to do despite what you might think, if you say you can't do it you won't get anywhere so like me i tried and tried and finally got some results. You will need a few tools to do this though, they are as follows.

1. Adobe Photo Shop 7.0 +

2. NVIDIA NormalMapper Plug-in for Photo Shop Which can be found here http://developer.nvidia.com/object/nv_texture_tools.html Look for the Fourth one down on the list. This is NVIDIA Software but it will work with your current Video Card if you have one.

3. Some Textures to work with.

4. And of Course DarkBASIC Professional

We Begin, start off by finding your textures you want to use for Bump Maps, maybe search through DB Pros Texture Library to find one or more you like, Copy and Paste them somewhere where they can be easily found with minimum Browsing, for me I'll be using the Brick18 Texture as my choice.

Once you have found your Textures and feeling good about them, download the NormalMapper Plugin shown above if you haven't already. Let the file download, when it's complete place the Plugin into the C:/Program Files/Adobe/Photoshop/Plugins/Filters

Load up Photo Shop, and open the texture you want to work on, once opened convert the Texture to a black and white image, don't grayscale it you want this image to use RGB channels Goto Filter>Sketch>Photocopy set the detail and darkness to where it looks good to you then click ok this will make the image appear to be a greyscale but it's not.

Next on the right hand side of photoshop on the very bottom box click on the channels tab, this will change the box so it displays your RGB values, next create a new channel by clicking the button to the left of the trash can, this will create a new channel called Alpha 1, next click on one of your color channels, but not alpha channel, and (Ctrl+A) THEN (Ctrl+C) to copy it into the memory we for use later. Now select the Alpha Channel then Shift + Leftclick on the Red, Green, Blue Channels in that order now everything should be selected including your Alpha channel. Next goto Filter>NVTools>NormalMapper The NVtools should be on the bottom of your filter drop down menu if not try installing the plugin again shown above, now with the NVIDIA Normal Map Filter open Under Height Source Select Average RGB, there you go your Bump Map is ready to be viewed click on the 3d Preview button to view your bump map.
[b]This is important do not skip, save your bump map seperate from your main texture save it as Brick18 Bump or something or your bump map will not work! [\b] More of the tutorial is continued below.
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 11th Aug 2007 02:36 Edited at: 18th Aug 2007 00:48
Okay so continuing on, this is the fun part this where we put everything together in a test 3d world, we code! here we go. Now the files i'm using like i said above will most likely be different from yours.



Okay the first thing we do with our coding is prepare a screen refresh for us by using the
command this will activate a screen refresh, the next command
will give us 30 frames per second and keep refreshing the screen as things happen. Next thing is the
Command this will give us a blue background so we can see things a little easier, and the
Command will hide the mouse cursor so we aren't looking at the mouse cursor. Moving right along we load our media, these things have been attached to the message and are free for your use, we use the
command for the media loading now we type in the name of our image followed by it's assigned number, do not forget to include the file type of your image as you can see above i have loaded three different images, one for the cube
and it's bump map
and one for the matrix
like i stated in the code block remember to move all of your collected media into your creations folder in other words your programs folder so these can be read easier and would not require us to write out the whole "C:\Program Files" thing it's just extra typing that isn't needed. Next we use the
line, we assign the Matrix a number by saying Make Matrix 1 then followed by the number 1, we assign 300 x 300 to the X, and Y values next we assign the segments which i have set at 12 x 12 this will give us 12 slices in the X and Y directions. Then we randomize the matrix using the
line this will allow is to assign height to our matrix we tell what matrix to effect and the random number that will give us our height, so we use 1 as our matrix number and 20 as our random number that will create hills for us. Next we re-locate the matrix by using the
line first we tell the command to effect matrix 1 then we say 0 for X, -15 for Y, and 0 for the Z coordinates we assigned -15 to Y so we can position the matrix below the main camera so we can walk over it. Next we will texture the matrix using the
line we tell it to assign a texture to our matrix, then well tell it what image number will be used as the texture, then we actually effect the matrix by telling it we need the texture applied 1 box unit across and down. Next we make a cube to apply our bump map to by using the
line we tell it to assign the Object a number of 1 as an id number, next we apply a size to it which will be 10, next we scale the object by using the
line to assign which object we wish to effect which will be 1 now we tell the object to scale in the X,Y,Z coordinates you can go ahead and scale the object to your liking but i picked 30, 90, 30. Now texture the cube using the
line we say we want object 1 to be textured, and the image number to texture with which is 1. Next we create an Ambient light using the
line after we key the command in we set the light percentage to 100 so we get a bright scene, next we will color the light by using the Color Light so we say
Next we tell the program to give us a bump map with the use of the
line what this will do is give us a reflective surface that will update when it hits the light so we tell the program to effect the cube by using the object number of 1, then we tell the program to grab the bump map image which is 3 and apply it to the cube. Next we setup a loop by using the
line this will tell the program to keep running as long as the Escape key is not hit, inside the main loop is where we apply our motion. The first thing we want to accomplish is rotate the cube constantly here we say
here we tell the program to rotate our cube (Object 1) in the X Direction, followed by the the Positive X direction so the cube will be rotating. Next we can control the camera with the use of simple coding so don't assign any variables by using this
here we tell the program to allow for control by the use of the arrow keys we control (Camera 0) which is the default cam for every 3d program done, then we give it a speed of 2 and a turn speed of 2. Next we refresh the screen by using the
command this will allow the program to constantly update the screen by the refresh rate we setup earlier which was
line. Then we simply tell the program to loop constantly using the
line.

Well thats it i have updated this part of the guide to give you a better example of what each of these things do by themselves. The media i used was included below but you will need Winrar to extract the file linkie http://www.rarlab.com/download.htm. There you go enjoy the tutorial and happy coding

Attachments

Login to view attachments
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 11th Aug 2007 02:43
Okay so continuing on, this is the fun part this where we put everything together in a test 3d world, we code! here we go. Now the files i'm using like i said above will most likely be different from yours.



And thats it, i hope you enjoyed this tutorial Happy Coding
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 11th Aug 2007 03:54
Sprry for the double post, PC was being wierd
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 12th Aug 2007 14:26
Is Photoshop absolutely required, or can we use something else, like GIMP?


[center]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Aug 2007 19:27
I've altered the post topic as this isn't really a tutorial - it essentially only explains what to do in Photoshop 7. Most people won't even have this, making it useless for them.

The second half of the 'tutorial' is just a code snippet. It doesn't explain what the code is doing or why. In a tutorial, people want to know what a command is doing and read what the parameters are for.

Also, why not include all the media if it's a tutorial so everything is available?

Check out number 15 here:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

TDK_Man

Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 12th Aug 2007 22:44
I apologize i guess your right this was more of an explanation, i guess what i could do is remake this, sorry folks i thought i was being helpful is all so TDK if you wish go ahead and remove this post, i guess it really doesn't help much.....
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Aug 2007 15:36
It does help, it just needed a more appropriate title. Add the bits TDK mentioned, it will be very useful

Noonster
18
Years of Service
User Offline
Joined: 10th Jul 2006
Location: Idaho, USA
Posted: 13th Aug 2007 18:17 Edited at: 13th Aug 2007 18:19
@Firos12: Thanks for posting this, and don't take things the wrong way. TDK is just giving pointers, and I agree with BatVink in that it is helpful. I had been meaning to experiment with normal/bump mapping and your post spurred me on. Your coding steps worked for me (I used a texture and normal map that were already pre-done).

@Veron: Apparently, GIMP can be used. The plug-in can be found here:
http://nifelheim.dyndns.org/~cocidius/normalmap/

I use GIMP as well, but have not yet tried the plug-in.
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 14th Aug 2007 05:05
Well the plugin that i listed only works for Photoshop, but thanks for the feedback, I'm glad it helped and i am glad to see that Gimp works for this purpose, i have yet to figure how to get the Bump map to reflect light when the fixed object moves instead of staying right on top of it. Yeah if anyone has any questions let me know with a PM or here.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Aug 2007 18:49
Quote: "if you wish go ahead and remove this post, i guess it really doesn't help much....."


But it does help. I wasn't suggesting it wasn't useful and certainly doesn't warrant deleting. It's just not detailed enough to be classed as a 'tutorial' - more a useful guide.

It's certainly a subject I'm sure many would like to know more about and you can easily edit your own posts to add more to what you have already done.

TDK_Man

Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 15th Aug 2007 20:03
I think i will do that here in a little bit, check back frequently folks.
Firos12
17
Years of Service
User Offline
Joined: 6th Aug 2007
Location:
Posted: 28th Aug 2007 22:41
How are you guys liking this?
Sopo the tocho
17
Years of Service
User Offline
Joined: 12th Jun 2007
Location:
Posted: 29th Aug 2007 02:59
Thank you! I´ll give it a try

Intel Pentium core 2 duo T6600 2,6 mhz 4mb, 4 gb ram 600 mhz ddr2, ATI X1650 radeon

http://www.freewebs.com/raycosantana/

Login to post a reply

Server time is: 2024-11-25 13:52:54
Your offset time is: 2024-11-25 13:52:54