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.

Work in Progress / [STICKY] Ultimate Shader Pack

Author
Message
Green7
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 21st Apr 2007 11:16
try his shadow mapping, that has a flashlight with shadow maps.

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 21st Apr 2007 12:00
Quote: "try his shadow mapping, that has a flashlight with shadow maps."

I don't want a shadow mapped flashlight, I think that would be a little to CPU intensive for my needs. I just want the lightmap flashlight effect.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Apr 2007 00:14
Quote: "GG, I think that shader is made for an object that ALREADY has the ligthmap textured on a second stage and is blended, like in a dbo file. It won't actually blend stage 1 UV into stage 0 UV, it's made for a dbo file that already has the proper blending set up."


What do you mean?

How are you applying the lightmap to your object?
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 22nd Apr 2007 01:13
Well, I'm using your lightmap shader that you posted in the other thread. In dark basic I texture stage 2 of the object with the lightmap, which doesn't blend the two. Your shader then blended stage 2 into stage 1. That flashlight shader does not do that, it's just a flashlight effect on stage 2. Since they aren't blended because your shader isn't there, it doesn't work right.

EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 22nd Apr 2007 02:23 Edited at: 22nd Apr 2007 02:25
So are you using a 3dws .dbo map ? ,

if not change this


to this


[Edit]

so its like this
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 22nd Apr 2007 05:08
Haha I'm confused as to what the confusion is here. I don't think I'm explaining this right.

I have a .X level that is fully textured, and has an UNTEXTURED but UV MAPPED second stage for the lightmap. I generate the lightmap in 3ds max as an external image and texture my level with it in Dark Basic.

Here's how I set up my lightmap:



So the light map is textured on stage 2 of the object, but it is NOT blended. That's what I was using Green Gandalf's shader for, TO blend the lightmap. Your flashlight shader assumes thes lightmap is ALREADY blended, which it isn't for me. That's why I was trying to combine the shaders, to get the lightmap to blend AND have the flashlight.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 22nd Apr 2007 13:52
Quote: "Haha I'm confused as to what the confusion is here"


You are right I'm afraid. EVOLVED's answer was quite clear - as was his shader.

Quote: "UNTEXTURED but UV MAPPED second stage for the lightmap"


In shader jargon, the "lightmap" IS a texture - and is applied to a texture stage just like any other "texture" or "normal map" or "specular map" or "light lookup table" or "cube map".

Your code snippet applies image 2 to stage 1 of object 1:



Check the syntax.

Quote: "Your flashlight shader assumes thes lightmap is ALREADY blended"


Nonsense - the blending is done in the shader, in the following lines of EVOLVED's shader:

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 23rd Apr 2007 00:45
I can't read or write

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Apr 2007 01:13
Quote: "I can't read or write"


Sorry, I didn't realise.

Seriously though, have you got it working yet?
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 23rd Apr 2007 02:44
@QuothTheRaven
simplest way just upload a simple .x level(box room will do) , and Ill see what I can do.

@dark coder
I decided to scarp thoughs 2 shader cus they looked pretty bad. Ill alter the post bloom effect and get it working under ps1.4 but most GFX card nower days have good support for ps2.0 though. as for the toon shader Ill try and revamp that. The edging (if I rember right) was just a second pass with vertex exceeding form there original position based on objects normals , so the only solution would be to add smoothing the object normals.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 23rd Apr 2007 13:24
Quote: "Ill alter the post bloom effect and get it working under ps1.4"


Great!, could you get them working with the latest DBP too?(6.6) as currently I get pretty much noise when running your post bloom shader you posted on the previous page, I need them to work with the latest version as I'm using a plugin which requires it.

EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 23rd Apr 2007 19:17
Here post bloom under ps1.4 dark, should work with 6.6 as Im using that version.

Post Bloom.. VS_1_1 PS_1_4
PostBloom(ps1_4).zip
Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 24th Apr 2007 14:41
I would still be very thankfull if somebody could do SM 1.4 water shaders.. Cuz i dont have SM 2.0 card.. (SM 1.0 would be great too ) Thank you..



Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 24th Apr 2007 15:28
you're right
it may be really cool to have the same shaders running on various PS/VS versions so, we can make our program select which one is the best.

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 26th Apr 2007 10:12
Attached is an example .X file and DB program. The .X is textured regularly and has the second stage ready for the lightmap. When I use the shader at first the object is purely black, but if I turn on the flashlight (pressing 'f') then the texture becomes messed up. If you comment out lines 20 and 21 you can see the lightmap textured correctly (these lines):

I may be doing something wrong but I'm not sure what it would be

Attachments

Login to view attachments
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 26th Apr 2007 12:24
I get a windows error when I compile and run the 1.4 post bloom shader.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Apr 2007 22:57
@QuothTheRaven

Not sure what you want to achieve exactly - but are the attached screenshots anything like what you want. The first is with the flashlight off, the second with it on. I used the gravel image to texture the object. If that's what you're after I can post the code changes.

Attachments

Login to view attachments
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 27th Apr 2007 00:09 Edited at: 27th Apr 2007 00:12
No, that's not quite it. If you comment out the two lines in the code:

Then you can see what the actual lightmap texture is supposed to look like, and it's mapped correctly.

If you comment out the line that textures the object with the lightmap image then you can see the object is already properly textured, no need to texture it in DBP.

When you put the lightmap shader on it though, it seems like the UV data is messed up. The flashlight shader does not appear to be working correctly in this case.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Apr 2007 02:05
Quote: "If you comment out the two lines in the code:"


I thought I tried that earlier and just got the lightmap. However, I've just tried it again and it works as you've described.

There's got to be a simple solution and I think we are close - but it's late here now, so I'll have another look tomorrow (by which time EVOLVED will have the answer ).

Do you know how your object was textured? Was it stage 0 with different textures on different limbs? Was the texture scaled?

Just had one quick final look for today and I think it might be a UV scaling issue - won't know for sure till I look at the object more closely tomorrow.
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 27th Apr 2007 02:57
Duno whats up with your object but you cant re-texture it
try -


But reconstructing a mesh from your object the shader will work on it
- mesh from object


Changed flash light code -


I cant resolve your problem, it must lie in the texturing problem.

@dark coder
odd it should work , I don't get any errors :/
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Apr 2007 12:49
Quote: "I cant resolve your problem, it must lie in the texturing problem."


Me likewise.

Your object seems to be all on one limb (limb 1). Perhaps if you constructed it as two limbs, i.e. one for the plane and another for the box we might be able to texture the limbs separately (in DBP), one with the ply image, the other with the gravel. At the moment the only limb I can texture is limb 1 - and that gives the same results as before.

I haven't checked the object's format yet - will look now.

The shader itself seems to be working fine - it's one of those irritating object structure issues I suspect.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Apr 2007 14:35
@QuothTheRaven

Quick update. I can't find anything wrong with your object's UV data. I applied a "quick and dirty" fix to the shader so that it accepts both textures (the ply and the gravel). I attach 3 screenshots:

one with no shader
one with shader and flashlight off
one with shader and flashlight on

Do you want the Q&D fix?

Attachments

Login to view attachments
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 28th Apr 2007 02:41
I don't know because I can't tell exactly what's happening in the screenshots. When the flashlight is turned on does it just hide the lightmap texture or if you move around would there still be the flashlight image displayed over the object that fades with distance, is just a circle, etc? And when you say you made it accept both textures, does that mean the images names are hard coded into the shader itself?

I was able to get the blending of the lightmap and the base textures working using the shader you posted in the other thread, GG ( http://delvarworld.com/stuff/lightmap.fx ). I just replaced the shader in the code, and you can see the result in the attached image. I'm pretty sure there's nothing wrong with the object's UV data.

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: 28th Apr 2007 22:41
Quote: "When the flashlight is turned on does it just hide the lightmap texture or if you move around would there still be the flashlight image displayed over the object that fades with distance, is just a circle, etc?"


That is a good point - I forgot to check that. I probably won't have time to do much coding this weekend but my initial guess is that there will be a variable in EVOLVED's shader which affects the attenuation of the flashlight. That might need tweaking in the DBP code via "set effect constant", etc.
game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 2nd May 2007 05:30 Edited at: 2nd May 2007 05:31
How come the evolved water shader is all messed up whenever I run it?Just to let you all know I have a geforce 7900 graphics card which does great shader jobs on all other shaders. I dont think the problem is with my computer. I also didnt edit the code either I just ran it with the debug exe mode. Here is the pic of just how messed up it is for me!

gm07

Attachments

Login to view attachments
Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 2nd May 2007 10:24
again this same question... U should change the FX cameras they were 31 and 32 if i remember right..


[B] - LINKIN PARK - [/B]
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 2nd May 2007 17:42
Yes, change them to 1 and 2 it may work. I don't know why DBPro does now not handle correctly cameras numbers ...

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
game master 07
17
Years of Service
User Offline
Joined: 26th Feb 2007
Location: Maryland
Posted: 3rd May 2007 00:06
Thanks I got it working now. One more thing though. How come both the post bloom and flashlite keep crashing whenever I try to run them? I run them in debug mode but evreytime it crashes dbp and a DBPCompiler.exe has encountered a problem and needs to close. message pops up. Like I said before I have a geforce 7900 so there should be no reasone
why it only crashes on these to shaders. All the other shaders work just fine but not these to. How come?

gm07
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 3rd May 2007 07:04
@EVOLVED

Are you using 6.6b? as I have two 7880GTXs so there should be no issues running the shaders, your HDR shader works however, as do a few other ones I tested.

QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 3rd May 2007 07:47
Any updates on the flashlight / lightmap combination?

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th May 2007 01:38
Quote: "Any updates on the flashlight / lightmap combination?"


Not really. Had a quick look at the light attenuation/light range issue and it doesn't work as I expected. When the camera is a long way from the object you just see the lightmap. As you move closer the shaded areas gradually brighten. But, as you get really close they go dark again, and in neither case do I see the expected limited area lit by the flashlight. The flashlight seems to affect all areas equally which I am sure is not the intention. I may need to get into the details of the way EVOLVED has coded both his dba demo and his flashlight - in which case it would almost be easier to start afresh myself (I do have a simple flashlight shader somewhere - but it has defects).

I still have an issue with your object. Do you know how you managed to get different parts textured with different images? It is easy to do that in DBP if the object has more than one limb - but your object has only one limb as far as I can tell. I managed to get two textures applied by cheating - I added some lines to the shader to check the geometry to see which texture to apply. That fix is obviously not a general solution.
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 4th May 2007 06:17
Quote: "I still have an issue with your object. Do you know how you managed to get different parts textured with different images? It is easy to do that in DBP if the object has more than one limb - but your object has only one limb as far as I can tell. I managed to get two textures applied by cheating - I added some lines to the shader to check the geometry to see which texture to apply. That fix is obviously not a general solution."

I textured my object in 3ds max. Just selected the polygons on the box and applied the plywood texture, and selected the polygons on the ground and applied the gravel texture. All game levels are textured this way, with different tiling textures applied to different polygons. Unfortunately it would be absolutely impossible for me to texture my levels using Dark Basic Code, even if the object was seperate limbs.

But the issue can't be that hard, right? As I posted above, your old shader makes the lightmap work perfectly, and all you have to do is multiply the flashlight image into the lightmap texture and texture the level's lightmap UV stage with that combined texture.

In the example that you posted the lightmap seems to be very stark and has lots of contrast, and textured wrong in some of the pictures.

TATO 4 EVER
17
Years of Service
User Offline
Joined: 7th Dec 2006
Location: Montreal
Posted: 4th May 2007 08:53
To EVOLVED or Green Gandalf:

Hi guys
Firstly, let me introduce my self. Am a french canadian, i live in Montreal, Quebec.
Am working on a survival horror game with a small team of 4 members( 1 programmer and 3 artists ).
We are using EVOLVED Parallax mapping, normal mapping, bloom and we would like to introduce the softshadows shader( it make's a good atmostphere!).

Here we go :
I think the EVOLVED softshadow's shader have a bug. I put a video in the attachment showing it...

I have a geforce 6800GT, with all the drivers up to date ( video card, directx,...). My DBP is the lastest one, 6.6b ver.
I heard others guys on the forum have the same problem with this shader.

By the way, your shaders guys are wonderfull!!!
We are working on the project, since agust 2006 ^^. It will be finished sometime next year.
Any suggestions for this littler bug?
Sorry for my poor english ^^.


You think you r good enozz? Me notzz!!
Love DBPro, DP & DAI...

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: 4th May 2007 23:50
@QuothTheRaven

Quote: "As I posted above, your old shader makes the lightmap work perfectly"


That at least is good news. However, to make progress with your present query, it would help me enormously if you could post the whole example - your dba file + media + my shader. I can probably sort out the flashlight quickly then. At the moment I'm a bit stuck.
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 5th May 2007 00:41
The working example is attached

Thanks for your help in this, I really apprecieate it. My game is kind of on hold right now until this is fixed, because I don't like to work on a lot of things at once and leave pieces of code broken and unfinished.

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: 6th May 2007 00:19 Edited at: 6th May 2007 00:36
Quote: "because I don't like to work on a lot of things at once and leave pieces of code broken and unfinished"


I know what you mean. I tend to have the same attitude. Unfortunately, it means that things DON'T get finished because there's always some silly little detail that isn't quite to your satisfaction - and probably nobody else would notice anyway.

Anyway, thanks for the example - I'll give it a go, but probably not tonight.

Edit Just a quick post to confirm that your demo works (once I got hold of the spotlight2.dds file ). I'm sure I can get something working with that demo - but not tonight.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th May 2007 16:14
@QuothTheRaven

Got your problem sorted - the solution surprised me and I don't yet know the reason for it. (But I'm still surprised I didn't try this solution earlier.)

I eventually realised that the only significant difference between my shader and EVOLVED's flashlight shader was the shader version used in the compile step in the shader. As soon as I changed EVOLVED's shader to use VS and PS2.0 the problem disappeared. I've made a few other changes to improve the balance between the lights.

I've trimmed down EVOLVED's shader to just the flashlight with lightmap in the attached demo. You can probably proceed from there. Let me know how you get on.

Attachments

Login to view attachments
JosephB
17
Years of Service
User Offline
Joined: 12th Sep 2006
Location:
Posted: 7th May 2007 21:53
Green Gandalf,

Your solution fixed the problems I had with some of the shaders. Thank you very much.
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 7th May 2007 23:45 Edited at: 12th May 2007 19:02
I've played a bit with the shaders pack and I tried to add a few things. I've changed the Evolved's normal mapping shader : it can render alpha-transparency and the 3rd texture stage is now used for the specular map.
It's slower and need PS 3.0 but the specular mapping really better the render (considering it's one of my first attempt with shaders, I think it's quite good ).

General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 13th May 2007 18:10
Evolved - Do you think you would be able to add lights to your excelent soft shadow shader?
I would really appreciate it

-Gen Reed

Your signature has been erased by a mod because it violated the AUP
Pus In Boots
18
Years of Service
User Offline
Joined: 5th Nov 2005
Location: S.M.I.L.E. industries
Posted: 13th May 2007 22:17
Fredix,
First I'd like to say how great this pack is. More importantly, I want to enquire about the cartoon shader. I've been playing round with it in FPS creator and I want to know if you can modify the outline. I want it to portray a white outline around an object. Can this be done?

Please sign here
dontaskme
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: CH
Posted: 16th May 2007 12:24
First of all, big cheers to the experts in this thread sharing their knowledge about shaders. Reading your posts alone have really given me a good kick in starting with shaders. (bow, bow)

So here's the question: How can I get cut-out texture transparency in my shader?
The problem comes up with low-poly meshes for flowers. I am using a PNG atlas with an alpha map. The flower blossom is made from a few polygons forming a concave disk, and the petals are drawn and masked in the PNG. (Same method applies to feathered leaves and similar plant parts) In DB I used to texture the x file and set the transparency, that worked well enough. In DS, I tried to light up the model with Evolved's PerPixelLighting shader, and then started to mess around with some render states (I'm not even sure whether this is the right term)

Until now I have no satisfying results. Looking up the blend options at msdn did not really help. I still have the border color of the PNG on my polys.

I don't know if I am on the right track, or if there is a completely different (better, easier) method for that. If someone could give me an hint I would be very happy.
There is some material attached. (hope it works)

btw: I did not find another shader thread for my question. If there is a better one please point me there.

Attachments

Login to view attachments
Benji
18
Years of Service
User Offline
Joined: 17th Dec 2005
Location: Mount Doom
Posted: 17th May 2007 05:34 Edited at: 17th May 2007 05:35
I have a prob with EVOLVED's soft shadow shader.

1. when I look at the light source the screen flashes.
2. I can see a blured image of what looks like what the main camera is seeing, on the walls and floor.

I also have a quiestion about the depth of field shader, by EVOLVED. Is it possible to have the blur effect without the normalization shader, or whatever, that's on the object the shader is applied on? I can't get it to work without it.

...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th May 2007 13:17
@dontaskme

Try the following dba code which uses your media plus the attached image plus a simple test shader.

The shader uses an alpha mapping idea suggested by cjb2006 as a solution to a related problem. It seems to work nicely although it might not work in all situations.

I guess you can make the necessary changes to the other shaders.

dba code:



FX file:

Attachments

Login to view attachments
dontaskme
20
Years of Service
User Offline
Joined: 20th Jan 2004
Location: CH
Posted: 17th May 2007 15:21
YƤsss! Works like a charm.

Thanks a lot, Green Gandalf (and cjb2006 of course)
Licaon
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: Far in the south
Posted: 23rd May 2007 20:29
I'was triying to fix de shadow shader, into using a point light, with parallel shawdows, that is, no matter how far the light is every object cast a shadow over itself...failure after failure, i thought using the default shading shader of db, but it is slooooow...any ideas?


9 of every 10 people are exactly the 90 %
el zilcho
17
Years of Service
User Offline
Joined: 4th Dec 2006
Location:
Posted: 25th May 2007 21:28 Edited at: 25th May 2007 21:28
i dont know very much about shaders so i don't know if this is a stupid question..

would it be possible to make some sort of a projector shader. to say, project an image onto any object, sort of like the shadow or the flashlight shaders do?

and which tools might be best to create this shader? if any..
Roxas
18
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 25th May 2007 23:32
U mean projection camera?


[B] - LINKIN PARK - [/B]
bandM
17
Years of Service
User Offline
Joined: 27th Sep 2006
Location: Home
Posted: 26th May 2007 13:41
I think it's some kind of cubic lighting,am i right??
Licaon
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: Far in the south
Posted: 27th May 2007 04:49
yes, that would be cube shading...point light, not spotlight shadows. I was reading something about it...but it seems a little over my head right now...i keep on triying anyway

9 of every 10 people are exactly the 90 %

Login to post a reply

Server time is: 2024-03-29 05:44:07
Your offset time is: 2024-03-29 05:44:07