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.

Dark GDK / bump mapping, bugged or not?

Author
Message
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 19th Jul 2007 22:54 Edited at: 19th Jul 2007 23:01
I really cant tell from the forum. I see so many tread uncompleted. Another is bump mapping, is this a know bug, or is it working?

Here is my attempt..


this one show the images as invisible. Like transparent.



also tried this



this one seems to bled the images original image and the load new image. I don't seen any bumping.
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 19th Jul 2007 23:07
Unitech the setBumpMapping is bugged, try using one the Normal Map shader.

EVOLVED Shaders

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 20th Jul 2007 14:30
Got to love that good old 404. Not the website, just the example for normal map. Are all of the examples dbpro?
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 20th Jul 2007 16:44
Sorry didn't know about the 404 here's the link for the ultimate shader thread where you can find it

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 20th Jul 2007 16:52
I know I keep seeing all of this wonder shader stuff but nothing for gdk. I wish I had time and skills to convert them..
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 20th Jul 2007 17:46 Edited at: 20th Jul 2007 17:49
unitech here's an exemple of normal mapping



PS Try to rewrite the code of dbp shader examples to understand, that's what I've been doing

Attachments

Login to view attachments
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 20th Jul 2007 21:31 Edited at: 20th Jul 2007 22:05
First I want to thanx you. That was very informational. I think I see how some of this fx stuff works now.

The example you gave my didn't work. I'm sure its on my end. I used your exact code, with know working normal images. See screen shot. Not sure what Blues clues is trying to tell me here? Maybe Ill figure it out before you have a look.

Attachments

Login to view attachments
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 21st Jul 2007 00:47
.....when you load something from a directory you need double slash (\\) ex: dbLoadEffect("effects\\FXNormalMap21.fx",1,0);

James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 21st Jul 2007 01:16
There seems to be an error in the link on that page Jna99 first linked.
But you can access all EVOLVED shader's anyways here:
http://files.odyssey-creators.com/shaders/

Using Dark GDK.NET
Charles
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 23rd Jul 2007 07:10
Unitech,

The fault is NOT with you. I'm having the same problem as well. TGC is getting either too busy or too lax in fixing up its problems in its C++ GDK. I'm currently considering whether or not to actually learn DirectX, instead of waiting for the bugs in the GDK to be fixed.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 23rd Jul 2007 14:54 Edited at: 23rd Jul 2007 15:00
Quote: "The fault is NOT with you. I'm having the same problem as well. TGC is getting either too busy or too lax in fixing up its problems in its C++ GDK. I'm currently considering whether or not to actually learn DirectX, instead of waiting for the bugs in the GDK to be fixed."
-oh??

Jna99 , let me give that a try, I cant believe I missed that? Fridays....

EDIT:

Actually, I take that back Jna99, it was not I. It seem to have been a forum thing.

exaple If you edit a post that said this..

dbLoadImage("Frigate\\uh1.png",4,1);

it will kill a \ and make it.

dbLoadImage("Frigat\uh1.png",4,1);
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 23rd Jul 2007 18:34
OK unitech tonight I'll upload my source with the executable and textures!

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 23rd Jul 2007 19:23 Edited at: 23rd Jul 2007 19:23
Jna99 , it is not necessary if it works for you, your word is good. Could be a texture thing I guess so it may not hurt. Charles , here seem to think its buggy also LOL, must be missing something if it is works for you. Are you using the latest upgrade, maybe that broke it?
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 23rd Jul 2007 20:22
unitech here it is, code, media and executable. One thing this shader is from Evolved, the previous was from Matt (this one is better in my opinion). Any doubt just say..

Attachments

Login to view attachments
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 23rd Jul 2007 20:42 Edited at: 23rd Jul 2007 20:48
Then it certainly has to do with our systems?

I don't suspect this would be the out put?

I tried on 2 flavors of nvidia and 2 flavors of ati, what card do you have?

Attachments

Login to view attachments
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 23rd Jul 2007 22:12
I really don't understand, maybe Pixel Shader?...I've got a NVidia 7800.

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 24th Jul 2007 06:29 Edited at: 24th Jul 2007 06:50
Yup worked perfectly on my 7800, 5600 , 6200 and at home, I guess there is something to the Pixel Shader.
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 26th Jul 2007 14:43 Edited at: 26th Jul 2007 14:46
Ok, new card and it works.

would this not be the way to use a secondary light source?



** this is using a vector, object, and light class, of course.


I cant see certain objects that I add the normal fx to, they are black. I'm assuming its because the light is wrong.
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 26th Jul 2007 16:11 Edited at: 26th Jul 2007 16:12
unitech if you want two lights at the same time in the scene do the following:


Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 26th Jul 2007 19:18 Edited at: 26th Jul 2007 19:22
don't you also have to call SetEffectTechnique(1,"Light2");

i usually open up the .fx file and familiarize myself with the code... that way i have an idea of the variables and techniques expected...

also, inserting this lil bit of code helps me see some of the shaders internals as well...



easily removed or commented out, put this inside the mainloop and it displays a list of the shader variabes while the code is running

--Mike
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 26th Jul 2007 21:02
ya I found that dbPerformChecklistForEffectValues earlier to day. It was helpful. Gave me a better understand of these fx files. Thx for your help Jna99.
Jna99
19
Years of Service
User Offline
Joined: 3rd Nov 2005
Location: Portugal
Posted: 26th Jul 2007 21:22
You're welcome, grad to help..

Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 26th Jul 2007 21:51 Edited at: 26th Jul 2007 23:02
here's a shot of my first bit of shader success... a simple shader implementation using Evolved's NormalMap shader...



only one light so far... i wrote out the code in DBPro first, as i was a lil more confident that i could experiment and debug whatever errors i got in DBPro... once that was working, i simply cut and pasted it into the c++ editor, fixed up the syntax, compiled and amazingly enough, it worked...

playing around now with changing the shader values from the c++ code, and using other meshes besides the primitive spheres and cubes in DB...

here's a first Type23 WWII sub being given the shadered treatment...



--Mike
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 30th Jul 2007 20:51
Wow looks great Mike. Can I see your bumpmapFX implementation. I still cant get the lights to work right. It's as though every light I add is ignored. Seems to be a light source above 0,0,0 and that all.
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 30th Jul 2007 22:28 Edited at: 30th Jul 2007 22:57
open up the shader .fx file with any text editor, and look at the tweaks section... the names there should look familiar...

i'm using Evolved's normalmap.fx shader... below...

the variables LightPosition_X will determine the respective lights positions... same with the LightRange and LightColor variables...

you can set em in the shader, or in your code (remember, all but the range are vectors)...

if you look further down, you'll see the different techniques for each light...

you can set them in your program as well...

here is the shader .fx code just in case... (i've messed with some of the variables)



all this you probably know and have done already... i just found out that when i changed the values in the shader code, the light position didn't change... but when i changed the values in my program code, it did...

so i guess it's a good idea to leave the shader alone and change the values from the program...

here's a small example of what i did to get 2 lites, using the default color in the shader for the second light, and reseting the second lights position to directly under the first one...



i put this in the main loop so it continually is available...

here's what it looks like with the default single light technique



here's what it looks like after adding that lil snippet... now
with 2 lights and the second one below the first



you can see the white light shining down and the red light shining from below...


hope this helps...

--Mike
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 31st Jul 2007 17:03 Edited at: 31st Jul 2007 18:12
Mike thanx you!

You saved me with one phrase "i put this in the main loop so it continually is available..." I had no idea the shader commands worked like that. I though they were a one time job. No wonder I never saw light change..

Now lets see how poorly I understand this..

(sets the light for the fx file to the second light in the scene)?
dbSetEffectTechnique (1,"Light2");

(creates a vector)
dbSetVector4( 1,0.0,-150.0,0.0,1.0);

(sets that light in the shader to the new vectors location)
dbSetEffectConstantVector(1,"LightPosition_2",1);

(set the range)
dbSetEffectConstantFloat( 1,"LightRange_2",300.0);

So I'm guessing the location is set by the vector created (red).the first light (white) is some how created by default. Is this in connection with my light(0) in the engine?

All I really need is one light, but I have to be able to move it. If I omit your 3 last lines.

dbSetEffectTechnique (1,"Light2");
//dbSetVector4( 1,0.0,-150.0,0.0,1.0);
//dbSetEffectConstantVector(1,"LightPosition_2",1);
//dbSetEffectConstantFloat( 1,"LightRange_2",300.0);

Nothing is shown. So this default light is some how messed up. All I get is a black scene. adding your 3 lines back gives me a red cast with bumped shadows ( if I change to LightPosition_1 I get white)as I should . And a beam of light is casted on my hull and follows the player. The camera is attach to the player, but all lights including the main are currently turned off. Si I don't really understand that beam of light. Added a screen shot.

Attachments

Login to view attachments
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 31st Jul 2007 18:13
yeah... you got it right... at least that's the way i see it...

i'm not 100% sure, but i think

sets it so you have two lights... up to light 2...
gotta really confirm this though...

now as far as needing the first light only, change the above statement to

now you should only have one light...

use these to change that lights position and range to whatever you want...


that should give you control of the first light only... lemme know if it works, i'll be working on some GDK and some 3Impact code for most of the day, so i'll be hanging around for a while here...

--Mike
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 31st Jul 2007 20:27
I believe its working well enough for now. Still have no idea where that beam of light is coming from.
Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 31st Jul 2007 21:16 Edited at: 1st Aug 2007 17:36
i'm whipping up a lil test app to verify some stuff i've been doing with this particular shader and lights... i'll upload it as soon as it's done... shouldn't take too long...

i need to test similar some stuff with 3Impact as well, so i'll use basicly the same logic on both... i'm making a tunnel, or a set of rooms, and putting some lights in each that can be turned on and off...


***** added ****

k, here's what i've come up with so far... the same shader with four lights working... one outside above the tube, and 3 inside...
(no on off switches just yet)





i've noticed a slight slowdown as the lights go above 3... but nothing serious though...

--Mike

Login to post a reply

Server time is: 2024-11-16 18:13:16
Your offset time is: 2024-11-16 18:13:16