Kinda looks like a ghost version of objects.
What it does can be read here in detail.
I could imagine this well as a special effect for powerups.
Attention: To get this effect working for a specific object, it needs the following line in the .material file:
The effect can be customized somewhat with 2 variables. The images below shows 2 different settings for those.
Also this can be added at runtime with AddFragmentShader. :)
This shader is not fine-tuned, I might do that at another point.
To install, attatch the code to your ObjectShader.glsl.
Obviously there are objects where the effect looks horrible. But for some it looks really nice.
I might develop this shader more when I work on my edge detection shader.
Have fun with it!
I hereby license the file silhouette_enhancement.txt under the CC-BY license
I got somewhat of a workaround for that:
If you add #ifndef OC_MESH --- #endif to the code, The effect will be limited to very few types. In a normal map this would apply mainly to rocks in the ground (so thats sprite-objects i think, excluding UI and sky)
Now...you need to add the scene_blend alpha_blend to the object you want to apply the shader to... and also have no other objects that require alpha-blending (cause they mustn't have the scene_blend alpha_blend)
But tbh, the #define category thing is kind of a mess and sometimes hard to understand :/
Edit: Or you could go the other way round and use #ifdef OC_MESH, there might bew fewer problems that way.
>I don't think this is possible without a AddFragmentShader-Call that would target a specific object (or is there one?)
The shader programs are only compiled once (not sure whether they're shared between definitions). It may be possible to target specific objects using uniforms set from script, but this would also require a uniform with the object number or something like that.
Honestly, I had a small private rage at those trees already x)
The leaves cause many problems when I play with lighting.
Edit: However, trunk and branches are very good :)
Nice shader effect btw. It looks inverted on the some leaves, b/c they don't have backface culling enabled. Otherwise halv of the leaves would be missing and it would not look so fluffy.
It could be modeled to look good from one side, but then the variety is missing.
Maybe we need another approach on modeling trees.
> Couldn't an extra material be assigned to the leaves so that other model parts are not affected?
That might work, but I don't understand materials well enough yet to say for sure.
>Maybe we need another approach on modeling trees.
The main problem is realy just the big planes with a sharp angle to the viewer. This also exists on some buildings.
The way they just end without being connected to anything is part of that.
Models would have to be smooth (i.e. like this)
>Nice shader effect btw
Thanks :3 This is my outline based on this shader.
You can even change the color of the effect from white to whatever you like. Change it to black and you see how my outline will work.
I hereby license the file se2.txt under the CC-BY license
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill