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 / Bloom shader.. help!

Author
Message
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Nov 2010 16:44 Edited at: 14th Nov 2010 17:00
Hello, I have been playing around with the basic bloom shader included with darkshader, and also bond1's bloom shader. You may have seen my question in a the "Adaptive bloom shader by Bond1!!" thread. Rather than hijacking an info thread as such I though I would post this up, to see if any shader boffins out there can help.


That is the code in it's entirety, rather than the snippet I put in the aforementioned post. Turn off/on bloom by changing bloom=0 to bloom=1 at line 455.
Basically I am either getting a black screen or as I have now discovered since altering the media code a little for posting, I see the last thing that was drawn to screen before the 3d objects were made( the target graphic). If I turn off the bloom obviously it all works fine. It seems as if it is texturing the plain with the last image grabbed rather than the camera image? I cannot see where the shader gets it's image from as it seems to use image 1 which should be the suns image.
I'd love to get this working nice and early on before things start really getting more complicated. I think it s a camera/image problem somehow, but am unable to work out what's happening.
I also lose all my info text when attempting to use the shader which I also can't see why as I place it in the correct place according to the demo. It just seems the image is static and is not updating.
Edit - accelerate and decelerate using z and x keys arrow keys control direction. Hold ctrl and z or x to increase boost. Just in case you don't want to work out the keystates

http://s6.bitefight.org/c.php?uid=103081
Dark Goblin
20
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 14th Nov 2010 17:28
So you want to use bond1's bloom shader in a DBP project?
Nothing more easy than that.

I used the old bloom version of evolved (in the old shader pack) and changed some commands and also replaced his bloom with bond1's .

Everything works just fine.

Here my working code:



... efxMod Developer!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Nov 2010 17:38
Quote: "I cannot see where the shader gets it's image from as it seems to use image 1 which should be the suns image."


But you told it to use image 1 in this part of your code:



The syntax for set camera effect is

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Nov 2010 21:03
@ Dark Goblin, That code is a little daunting as it uses even more shaders, and thus is a little confusing. I'll have a look if my current method fails to work. I am really trying to use the example code from my DB help files for now, and integrate it into my demo, I'd say game but I don't really think I can call it that yet lol.
The example code I am using.


@ Green Gandalf, I guessed one of them was an image flag, but my help doesn't give me any info. But am only using the original example as a guide. I cannot see anywhere in that code where image 1 is ever defined in any way. It makes camera 1, and it passes the effect it loads with the 1 flag, so it must be using image 1. Which has not been loaded or grabbed in the code.
So I am just as confused as ever.
Could you explain how the basic example is working please? That's not just aimed at green gandalf btw, anyone feel free to show off your knowledge, I won't mind . It would help me a lot more knowing exactly what is happening, rather than what I think it's doing.

I have got a little further than before I posted in some areas. Such as one thing that has both pleased and annoyed me. If I use set display mode, it causes the black screen or old graphic showing in the corner bug. Delete it and use the editors screen size and the objects appear! At least the target plains anyway not the planets. I tried adding a line in the demo and black screen, so that's half my problem. I hope theres a way round that, but not sure at the moment.

http://s6.bitefight.org/c.php?uid=103081
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Nov 2010 22:38
Quote: "If I use set display mode, it causes the black screen or old graphic showing in the corner bug. "


Try adding reload display pointer immediately after the set display mode command.

I've attached a file which it seems you haven't seen.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Nov 2010 22:51
Try the attached project. There was a silly error in the Dark Shader Help files at one point depending on which version of the quad.fx file you are using. I've marked the relevant lines in the dba code. You should be able to find the relevant line in your copy of quad.fx.
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 15th Nov 2010 00:14 Edited at: 15th Nov 2010 01:33
Reload display pointer worked a treat thanks. I certainly haven't seen a lot of those commands will come in useful! Not sure about the last post. Downloaded it and it works the same as the one I use, copied those lines over into my app you remmed about the bug and it does the same but shows a slight edge on the edges of the screen when the screen goes blank. Not had a look at the actual quad.fx file yet, but did copy the one you sent into my project instead of the original.

I am uploading a video at the moment to try to show the bug I have at the moment in action and will post a link when it is ready I am sure it is something silly I am doing somehow.

http://www.youtube.com/watch?v=o93vVXAwP44

http://s6.bitefight.org/c.php?uid=103081
Duke E
17
Years of Service
User Offline
Joined: 10th Mar 2009
Location:
Posted: 15th Nov 2010 09:14
Yeah there are some bugs in the DBPro code exporter and docs from DarkShader.

The "Set Effect Constant Vector" should be "Set Camera Effect Constant Vector" but there is a another error also

The ViewSize is a variable in the bloom.fx/dbs shader and assigned with a keyword not a variable (The terminology of keyword may be wrong, anyway it is automatically assigned a value).

InvViewSize is a variable in the quad.fx shader and this should be be set as 1.0/screensize (actually it seems unnecessary as the quad aligns the same if this is omitted).

Regards
Duke
DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Nov 2010 20:30 Edited at: 20th Nov 2010 14:49
I have been without broadband the past couple of days, so couldn't get back to this. I have finally solved it. I was originally using camera 0 for my space shift movement and (after adding the shader code), either moving camera 1 to match it or leaving camera 1 to view the quad. Now I am leaving camera 0 to view the quad and moving camera 1 around, and it worked sort of, it was hard to tell, as there seemed no real glowing edge around the sun for instance. I then changed the bloom shader to bond1's and hey presto it definitely works!

I include a pic and would like to thank everyone who gave me help and suggestions.
Edit - btw the suggestion above has no effect I get the same result with both versions with set camera effect or just set effect. Left it at camera anyway as it might be me but it seems a touch faster.


http://s6.bitefight.org/c.php?uid=103081

Login to post a reply

Server time is: 2026-07-21 18:59:02
Your offset time is: 2026-07-21 18:59:02