Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modifying the illumination Shader
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#1
Modifying the illumination Shader

Hi!

I have been trying to change the illumination shader:
Amnesia - The Dark Descent\redist\core\deferred_illumination_frag.glsl

to have bloom. But I'm not a good coder, nor do I know if it's actually possible to do - which is why I'm turning to you :]

[Image: glow-low.jpg]
http://devmaster.net/posts/3100/shader-e...-and-bloom

Something similar to this. The reason I'm asking is because while making Spacies I have a lot of illuminated models and textures. Spamming billboards works, but billboards look bad from certain angles and doesn't work in all sitautions.

One idea I had was to replace the illumination shader with the shader for 'itemglow' - it didn't seem to do the trick though.

Any help or (informed) opinion on why it's not possible is appreciated. Thanks!

[Image: mZiYnxe.png]


09-30-2013, 03:03 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Modifying the illumination Shader

----->gl_FragColor = texture2D(aDiffuse, gl_TexCoord[0].xy) * afColorMul;

I'm not a coder, but something tells me here's the secret... maybe, if you changed something from "* afColorMul" it would look brighter. Try "* afColorMul;" multiplied by two or three.

I have found this, it might be useful Smile

http://devmaster.net/posts/3100/shader-e...-and-bloom

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
09-30-2013, 09:04 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#3
RE: Modifying the illumination Shader

Hehe thanks. It's not brightness, but bloom I'm looking for (adjusting the values wouldn't help much). Basically, instead of having to use billboards the illumination map is blurred and 'shown in the air as light' - not purely on the surface of the texture.

The link is nice - included in the main post ;D

If it is to work one would have to write new code, or somehow modify the 'item glow' code.

[Image: mZiYnxe.png]


09-30-2013, 10:41 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Modifying the illumination Shader

I have found more links:

http://www.gamerendering.com/2008/10/11/...er-shader/

http://stackoverflow.com/questions/57631...ack-screen


By what you are telling me, blur could do the trick. Try mixing a bit of both bloom and blur shaders and I think you'll get what yiou want Smile

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-01-2013, 06:47 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#5
RE: Modifying the illumination Shader

Problem is, the shaders seem to be applied to things with in-engine code, correct me if I'm wrong but there's no way to 'apply' any of the available shaders manually, so adding shaders won't work.

Problem with changing the code of the existing ones, assuming you could get around the errors from not having control over the process, is that all of those articles suggest you need to apply several shaders to get that effect.

There is a bloom shader in the core\shaders folder, including the vertex & blur frag shaders & the other one to tie them together (i really have little idea how this works btw), so it seems like it's all there, but back to problem 1 ... how to apply it?

10-01-2013, 09:23 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#6
RE: Modifying the illumination Shader

Doesn't appear to be possible. The illumination pass is a simple render pass that appears to simply render the illumination texture into the framebuffer. What needs to be done for this glowmap technique requires modifying the native code to get a new glow-map render pass. This technique renders a glowmap into a texture, which you then blend into the final framebuffer in a separate pass. So unless you are an incredibly talented hacker....no cigar Sad

10-01-2013, 09:54 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Modifying the illumination Shader

(10-01-2013, 09:23 PM)Adrianis Wrote: Problem is, the shaders seem to be applied to things with in-engine code, correct me if I'm wrong but there's no way to 'apply' any of the available shaders manually, so adding shaders won't work.

Problem with changing the code of the existing ones, assuming you could get around the errors from not having control over the process, is that all of those articles suggest you need to apply several shaders to get that effect.

There is a bloom shader in the core\shaders folder, including the vertex & blur frag shaders & the other one to tie them together (i really have little idea how this works btw), so it seems like it's all there, but back to problem 1 ... how to apply it?

Maybe you could make an IFC with all the "core" shaders in a folder, just like an Amnesia inside an Amnesia. The changed shaders would be there, and would be used just for the IFC.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-01-2013, 09:56 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#8
RE: Modifying the illumination Shader

No cigar. Thanks everyone! Especially Adrianis/Palistov on skype!

[Image: mZiYnxe.png]


(This post was last modified: 10-01-2013, 10:01 PM by Acies.)
10-01-2013, 10:01 PM
Find




Users browsing this thread: 1 Guest(s)