Outline shader! HELP!!!!

Posted By: FinalMyle

Outline shader! HELP!!!! - 05/14/13 01:06

Hello! I am having some trouble and was wondering if anyone out there can help. This is, from what I can tell by surfing around the internet a simple request. Well, simple to what others have made. laugh I have a toon shader. I've been trying to alter it so it only draws an outline and does not shade the model. Leaving the model to be shaded by the enviroment. A simple outline shader for a model is all I need. I am not a programer, I have not studied. I'm usually good at figuring things out. However, with shaders....I'm am so lost. SO my question is, can onyone out there write a simple shader that will only outline a model? Credit will be given to the creator...as of right now that is all I can offer. laugh hopefully waiting.
I also feel I should mention that I am working in C-Script not Lite-C. grin thanks
Posted By: Uhrwerk

Re: Outline shader! HELP!!!! - 05/14/13 01:53

Originally Posted By: FinalMyle
I also feel I should mention that I am working in C-Script not Lite-C.

Time to switch to Lite-C!

There are two toonshaders with outline in the wiki. Does that help?

http://opserver.de/nwik3/index.php?title=Simple_Toon_Shader_New

http://opserver.de/nwik3/index.php?title=Simple_Toon_Shading
Posted By: FinalMyle

Re: Outline shader! HELP!!!! - 05/14/13 10:41

no, I have those. Thanks. I'm looking for one that doesn't SHADE the model...Just makes the outline around it.
Posted By: FinalMyle

Re: Outline shader! HELP!!!! - 05/16/13 12:29

I've tried altering those two shaders to just do an outline but as of yet, no luck. Can someone give me a tip? I've looked at other shaders that are not in c-script or lite-c and I have no idea how to convert them. (please don't reply, 'read a book') This isn't a comedy forum.
Posted By: Uhrwerk

Re: Outline shader! HELP!!!! - 05/16/13 13:10

I'm too stupid to do an outline shader, but if you have a working sample from a book you could post it here and I can help you make it work. Adapting shaders to gamestudio is by far not as hard as writing them yourself.
Posted By: HeelX

Re: Outline shader! HELP!!!! - 05/16/13 21:28

Originally Posted By: FinalMyle
just makes the outline around it


This seems to be an easy question but if you look at it, it is hard to solve, for several reasons. Maybe you can post a screenshot of a game in which you saw outlining that fits the style you want to achieve.

In the Gamestudio shader library is a toon shader, which creates an outline. If you want the model to be shaded regularily, comment the lines at the end of the "toon.fx" shader file (in ..\code) in which the PixelShader is called (lines 92 and 124). You can preview the shader in the shader viewer (see \projects\shadertest), but the model is too bright, you have to set the material settings to lower variables, I guess.
Posted By: FinalMyle

Re: Outline shader! HELP!!!! - 07/10/13 22:40

That shader doesn't work for me. frown it just makes the model completely black. I am currently using the toon shader that was mentioned above. I've had those since they were released. They work great for a simple toon shader.

I think maybe I'm posing this question/idea wrong. What I need isn't technically a toon shader....just an outline shader. something that does a thin black line around a model without affecting the coloring and shading from the environment. otherwords the model is still shaded and lighted by objects in the level (Static lights, Sun direction, dynamic light)

So just a shader that will outline ONLY laugh the model with out coloring it. That's what I need and I can't seem to write or figure out how to successfully alter someone elses shader.

Thanks all so far for your help! laugh
Posted By: NeoNeper

Re: Outline shader! HELP!!!! - 07/15/13 17:45

Digging up this topic!




I also have a lot of interest in a shader to do that

I think this is a solution, but do not completely understand.
http://answers.unity3d.com/questions/141229/making-a-silhouette-outline-shader.html

Someone has something?
Posted By: Nems

Re: Outline shader! HELP!!!! - 07/15/13 21:46

You might find a starting point in the approach so, determine what could be done (create a stencil shadow effect [reproduce the model then flatten it], define the outline of the flattened model then draw a line around it...)

Im not saying this is the process but rather giving a possible course of action to pursue the effect.

Hopefully other members might remember stuff that could help too...

Cheers....
Posted By: Anonymous

Re: Outline shader! HELP!!!! - 09/09/13 17:08

Did anyone eventually figure something out?
Posted By: Kartoffel

Re: Outline shader! HELP!!!! - 09/09/13 17:35

postprocessing.

depthmap + sobel edge detection, that's all.
Posted By: sivan

Re: Outline shader! HELP!!!! - 09/09/13 18:36

good info, useful for a rts style behind effect for units.
© 2024 lite-C Forums