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.

DarkBASIC Professional Discussion / The Ultimate Shader Thread 2.0

Author
Message
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 19th Mar 2006 17:06
I'm still clueless about how to get lightmaps and bumpmapping working on the same object. Anyone figured it out yet?

Only method I've found so far involves adding another texture layer inside the shader and blending it with the output, which is a bit crappy really. This would mean model 2.0 needs to be used but I want to try and get it to work on at least a geforce 4 (vs 1.1, ps 1.1 - ps 1.3)

Surely there must be a way of doing this through dbpro?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Mar 2006 11:58
Just started playing with pixel and vertex shaders and was pleasantly surprised that it was easy to produce effects by modifying the simple examples in the DBP Help/Examples/basic3d folders. However, to produce anything more useful I need the full assembly code instruction set for PS and VS version 2.0. I've tried searching the internet but can only find selected examples. Can anyone give me a reference (online preferably, but a book would do!) to the full instruction set?

I've tried using FX Composer and RenderMonkey but both seem to be unnecessarily complicated for what I want to do.
wh1sp3r
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 13th Apr 2006 18:33
I have problem with parralax mapping when i set new position of object :o) textures with effect are ...hmmm .. just effect not work correctly ... why ?

PS: Real programmers aren't afraid of math!.

☺☺ AthlonXP 2500+, Ati Radeon 9600 128MB, dualDDR 512MB 400Mhz CL3.0, SB LIVE!, monitor 19" ☺☺
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Apr 2006 19:53
@wh1sp3r

Can you give more details? Provide a short example program (dba file, not the exe) plus media - zip it all together and attach it. Parallax works fine for me - but it didn't until I upgraded my graphics card. I'll see what it looks like on my system.
Sayonari Omega Black
20
Years of Service
User Offline
Joined: 7th Apr 2004
Location: On my desk.
Posted: 8th May 2006 05:23
I have problems implementing the stenilshadowbone.fx file into one of my models, this is the code so far:



I assume that I have to pass some variables and one light but not sure how or what to do it.

Can someone help me here please.

Working on.
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 13th May 2006 16:37
@All :

Hello, I'd like to know if all persons that developped shaders that were available here agree with a small project I want to do. It's a free project for communeauty.

The objective is to find all available shaders and to give them (for free) in 1 pack file with 1 example for each shaders.
Some of them already own examples but some not so, I'll develop example for them.
If someone want to help in that project, feel free to contact me on MSN

Do all agree ?

All we have to decide is what to do with the time that is given to us.
Hawkeye
20
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 13th May 2006 16:55
Well, since this thread seems to have risen back to the top again..

Evolved's perpixel light shader (back a few pages) looks awesome, and runs smooth as anything, but what are those map thingees? One looks like a souped up normal map, and the other "says" it's a height map, but it looks a bit more like a spectacular map. I've done a lot of searching and I can't find any way to make said maps--any help here?

a/b with provided dot3 and my shot at making a normal map
dot3 (?)/heightmap view


I am but mad north north-west; when the wind is southerly I know a hawk from a handsaw - Hamlet, Hamlet
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 22nd May 2006 14:14 Edited at: 23rd May 2006 13:15
Ok, these are some useful links :

Shader Resources, by CuCuMBeR :
http://forum.thegamecreators.com/?m=forum_view&t=79169&b=1

Shader pack, by Lukas W:
http://forum.thegamecreators.com/?m=forum_view&t=79594&b=1

DBP Shader Helper, by MikeS
http://forum.thegamecreators.com/?m=forum_view&t=76210&b=5

@Freddix, that would be a very appreciated contribution, it is in everybody's mouth. (I don't have the time at the moment, sorry)
Alvarus
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Maryland
Posted: 23rd May 2006 16:05
I finally managed to get shaders working in my program, it took quite a bit of tweaking. For instance, the shaders turn my objects upside down and also flip all the normals inside out. I had to reexport the .x files with inverse normals. Neither of those is a big deal (took a while to figure out the normal issue though!).

However, with Evolved's per pixel lighting shader I've had an issue the the texture disappearing and reappearing when the camera moves. It only does it on some of the models. The .fx files are all copies; the only change is the texture string.

I've attached an image to show you what I mean. The two front models are the same, they share an fx file but I've instanced a separate effect for each object. The one on the left has the UV texture, the right doesn't (though it is affected by the per pixel lighting, so the shader is sort of working).

For now I'm setting the "Light_Position" shader variable in the main loop because the light is moving around at the moment (I took the code from the example). Eventually the light will be more or less static, so I can probably move that portion of the code outside of the loop, right?

The per pixel lighting is an order of magnitude better than the internal lighting, so I'd really like to get it working consistently. Anyone have any ideas?

Attachments

Login to view attachments
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 23rd May 2006 16:15
sorry i cannot help you Alvarus, i'm having problems too

look at this image http://forum.thegamecreators.com/xt/xt_apollo_pic.php?i=884165

i thought this was a per pixel shader with paralax mapping.
the bump/parallax mapping works, but not the per pixel light.

why is that?

(i use this shader: http://www.vector3r.com/Shaders)

my forum - now partly finished
Alvarus
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Maryland
Posted: 23rd May 2006 16:40
Lukas W, yea! The blind leading the blind! Obviously I'm no expert, but it looks like those are all separate shaders. Are you applying multiple shaders (per pixel, parallax) to the same object?
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 23rd May 2006 21:46
yes you are right. they are two separate shaders, how silly of me
now i need to find a way to mod evolveds code so it supports both normal mapping and per pixel light on the same object..

my forum - now partly finished
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 24th May 2006 00:04
daaa just use his paralax lighting which incorporates up to 6 light sources, normal map, per pixel lighting and paralx mapping!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 24th May 2006 08:46
if you are refering to "Lighting Shaders.zip" from his website, then that is the one i use, and i have tried all the different shaders.
so far only his "per pixel lighing" that is in that pack gives me per pixel ligts. the others give me vertex lighing with bump map.

or have he done something new that i don't know about?

my forum - now partly finished
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 24th May 2006 12:57
All shaders in Lighting Shaders.zip should have per pixel lighting.
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 24th May 2006 18:32
@Evolved:

Thanks for your great job done on the shaders side of DBP, I like your work and it helped me a lot! Keep up teh good work!

"Gangsters die, they don't go to heaven where angels fly!"
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Alvarus
20
Years of Service
User Offline
Joined: 24th Nov 2003
Location: Maryland
Posted: 25th May 2006 05:35
I found the answer to the disappearing textures. I set the flag on the load effect command to 0 instead of 1. This ignores the texture in the shader and uses a texture applied to the model. But the per pixel shader still works!
JulesD
19
Years of Service
User Offline
Joined: 7th Feb 2005
Location:
Posted: 25th May 2006 08:37 Edited at: 25th May 2006 08:46
@Evolved

Could I ask where or what you used to learn what you know now on shaders, cause that Paralax mapping demo is just amazing.
Olby
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 25th May 2006 20:14
Yeah maybe you could even point to some fx tutorials on the net...

"Error at line 0 - Your game sucks. Try again loser..." (Cash Curtis II)
AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 25th May 2006 22:48
There are some at the Shader Resources thread:

http://forum.thegamecreators.com/?m=forum_view&t=79169&b=1
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 30th May 2006 09:01
Ok, I give up with this cloud shader. No matter what I do trying to change the size / color of the clouds turns out stupid. Zeals, wanna help me out here?

headcrab 53
18
Years of Service
User Offline
Joined: 14th Jul 2005
Location:
Posted: 31st May 2006 00:43
Does anybody here have a per pixel lighting shader that makes a spot light instead of a point light?

Formerly known as covenant
Daris Xiao or Benjy Wright
20
Years of Service
User Offline
Joined: 13th Dec 2003
Location: Face first in a bowl of soup.
Posted: 29th Jul 2006 17:52
I'd just like to say that I found this thread absouloutely facinating and very helpful, and It took a whole lot longer to find it than I would have liked, even when I ran a search...


I hope I'm not being too bold in suggesting that this get stickied or something... just so it doesn't get lost in the back of the forums somewhere... lol.

Daris Xiao - Phonetic: Daris Shiao. aka: Benjy Wright.
2.0Ghz Pentium 4 - 512mb RAM - ATI Radeon 9800 Pro 256mb Video
Lukas W
20
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 19th Aug 2006 23:44 Edited at: 19th Aug 2006 23:46
did anyone build a volumetric cloud shader that works with dbpro yet?

it seems i can only find stuff for the opengl engine..

http://www.gamedev.net/columns/hardcore/cloudrendering/
http://downloads.gamedev.net/features/hardcore/cloudrendering/clouds_src.zip
Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 20th Aug 2006 00:09
Hey, guys, I need your help pretty bad.

I'm trying the HDR shader, the bloom shader, and all those enviroment shaders but they are all screwed up!!!!!!!!


The plain object that makes the effect doesn't fit/come up on the screen!

PLEASE help as soon as possible!

Applyby has Flies in his Eyes.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Aug 2006 01:15
Xenocythe

Are you talking about the "Ultimate Shader Pack 1"? I've recently downloaded and tested all the programs and fx files there and they all seem to work (although some work better than others).

I've just tried the "Bloom" example and get the attached screenshot. What do you get?

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Aug 2006 12:34 Edited at: 24th Aug 2006 16:18
I've just finished testing a bumpmapping shader with tweakable multiple lights, specular reflection, specular power and ambient light level.

The attached zip file contains a demo program and sample media. If you want to change the media, you will need to change the file names in the program and the FX files.

The demo program uses a simple textured rotating sphere with 5 effects:

1. simple texturing
2. DBP bumpmapping
3. GG bumpmapping version 2.0 with 4 lights
4. GG bumpmapping version 2.0b with 4 lights
5. Evolved's specular bumpmapping also with 4 lights (from the Ultimate Shader Pack 1).

The program allows you to move the camera and change the settings of the ambient level, specular level and specular power used in my shaders.

Version 2.0 uses the correct normalisation of direction vectors in the pixel shader (I hope!), whereas version 2.0b is a slightly faster version which does normalisation in the vertex shader relying on the built-in linear interpolation as an approximation (there is not much difference between the two). Both my shaders are slower than Evolved's which uses another approximation, but I think mine is more accurate for many purposes.

The method used for handling several lights is borrowed from Evolved's bumpmapping shaders - very nice.

Let me know what you think - suggestions for speeding up the shaders are particularly welcome.

[I think there is an error in Evolved's shader because the lights seem to move around if you watch his version in my demo without moving the camera. Only the object should move - the light directions should be fixed (you can of course change them by adding some extra code to the program if you wish as in Evolved's demo program). I think it can be fixed easily and I will submit a separate post with suggested corrections.]

Edit: amended some code in my FX files to correspond more closely with Evolved's calculations. Mine still run very slowly though - suggestions welcome. Also corrected (tentatively) Evolved's shader so the lights don't move when the object moves - and passed some more lighting constants to Evolved's shader so it shows up better.

Attachments

Login to view attachments
Xenocythe
18
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 24th Aug 2006 17:11
Yes, thats what I got in the example Green...

But I put it in my game, and I tried changing the resolution, I tried everything but the bloom object just didn't fit my whole screen!


Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Aug 2006 17:42 Edited at: 24th Aug 2006 17:56
If you post a simple example DBP program which uses the shader, I'll see if I can work out what the problem is.

Edit: just had a quick look at the "bloom.dba" code. You should be able to adjust the z coordinate of the bloom object so it fills the whole screen. If that doesn't work, perhaps you've accidentally changed its position somewhere else in the code - or you've moved/changed the camera? (I usually use the command "autocam off" at the start of my program - it often avoids this sort of problem.)
Bmad6
18
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 9th Sep 2006 06:14
http://forum.thegamecreators.com/?m=forum_view&t=88491&b=1

It's a thread in which I asked a couple of questions, which Green Gandalf answered and then he posted some excellent examples for beginners...

Harvard's Law, as Applied to Computers:
Under the most rigorously controlled conditions of pressure, temperature, volume, humidity and other variables, the computer will do as it d*mn well pleases.

Login to post a reply

Server time is: 2024-04-23 16:25:20
Your offset time is: 2024-04-23 16:25:20