Hey guys!
This is the result of my efforts to change the look of Open Clonk to a comic-like style.
It's a modded CommonShader.glsl and ObjectShader.glsl you can replace in your Graphics.ocg folder.
I still don't understand every detail of the shader code and there are still things that could improve (cloud-like objects still look horrible in most situations).
There are a lot of settings you can tweak (including anti-aliased color transitions) and I marked/commented all the code I wrote.
Standard settings are my favourite.
Let me know what you think and have fun with it.
And feel free to mod it any way you want.
Update 1.1:
- Added a working optional outline shader. Still not looking that good, but I can't do any better for now. Messes with transparency cause I use alpha data to transfer other information.
- AA for all color transitions (sadly not for 3D-object outline)
- Optional hilite-shader (normal-based)
- Lots of small tweaks
- Modded ObjectShader.glsl is now also required
Planned for next release or as an extra shader: 16/256 color mode for textures.
New pics:
I hereby license the file CommonShader.glsl under the CC-BY license
I hereby license the file CommonShader-1.glsl under the CC-BY license
I hereby license the file ObjectShader.glsl under the CC-BY license
This is the result of my efforts to change the look of Open Clonk to a comic-like style.
It's a modded CommonShader.glsl and ObjectShader.glsl you can replace in your Graphics.ocg folder.
I still don't understand every detail of the shader code and there are still things that could improve (cloud-like objects still look horrible in most situations).
There are a lot of settings you can tweak (including anti-aliased color transitions) and I marked/commented all the code I wrote.
Standard settings are my favourite.
Let me know what you think and have fun with it.
And feel free to mod it any way you want.
Update 1.1:
- Added a working optional outline shader. Still not looking that good, but I can't do any better for now. Messes with transparency cause I use alpha data to transfer other information.
- AA for all color transitions (sadly not for 3D-object outline)
- Optional hilite-shader (normal-based)
- Lots of small tweaks
- Modded ObjectShader.glsl is now also required
Planned for next release or as an extra shader: 16/256 color mode for textures.
New pics:
I hereby license the file CommonShader.glsl under the CC-BY license
I hereby license the file CommonShader-1.glsl under the CC-BY license
I hereby license the file ObjectShader.glsl under the CC-BY license
Attachment: CommonShader.glsl - Custom Cel-Shader 1.0 (10k)
Attachment: CommonShader-1.glsl - Custom Cel-Shader 1.1 (Common) (11k)
Attachment: ObjectShader.glsl - Custom Cel-Shader 1.1 (Object) (4k)
Cool! Is the shader built so you can just add one or more slices (so it could be enabled at runtime with AddFragmentShader)?
Or did you modify the existing slices?
Or did you modify the existing slices?
I did modify the existing slices. I don't think I can do it with separate ones, there is just to much happening.
But feel free to look at the code yourself and tell me if that could be possible^^
But feel free to look at the code yourself and tell me if that could be possible^^
Looks very good, the completely black edges beyond the light range are bit hard for my taste however. Also our current skies look terrible with this shading, is there a way to modify them in the same manner?
You mean the 2D Sky-texture should be cel-shaded too? I think I can do that.
Hard black edges can be turned off in the shader settings.
Hard black edges can be turned off in the shader settings.
I like it very much. I think I will use it for the Shire scenario, it would fit well there. I am just lazy and reluctant to keep updating it.
You're welcome :)
Cool :) Looking forward to see it in action!
Cool :) Looking forward to see it in action!
Ok so I got another idea to get a working outline. Saw it here
Basically I want to render Mesh-Objects semi-transparent, so that areas where the modle is the thickest will be opaque.
Then I could check (from standard player viewpoint) what parts would be drawn opaque and color those parts in black. Then revert transparency changes.
However, no matter where I put my fragColor.a = 0.5; I can't get the models transparent.
I get transparent trees, landscape, groundobjects ... basically everything but the models.
How do I do it? Please help.
Edit: Thinking about it, fragColor doesn't evenn make sense, 'cause I want model-textures to be transparent. But I can't find values for textures that indicate alpha.
Basically I want to render Mesh-Objects semi-transparent, so that areas where the modle is the thickest will be opaque.
Then I could check (from standard player viewpoint) what parts would be drawn opaque and color those parts in black. Then revert transparency changes.
However, no matter where I put my fragColor.a = 0.5; I can't get the models transparent.
I get transparent trees, landscape, groundobjects ... basically everything but the models.
How do I do it? Please help.
Edit: Thinking about it, fragColor doesn't evenn make sense, 'cause I want model-textures to be transparent. But I can't find values for textures that indicate alpha.
If trees are affected, the only reason I can think of as to why: trees use 'scene_blend alpha_blend' in the material. There are a couple of objects using this for transparent textures. Maybe it only works on those objects?
Yes, that worked, thanks!
The object needs the 'scene_blend alpha_blend' in the material file defined
The object needs the 'scene_blend alpha_blend' in the material file defined
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill