Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate

Python/GLSL cell-shading script

Author: 
WorkInProgress
Saturday, June 29, 2013 - 08:47
Art Type: 
3D Art
Tags: 
Python
toon
bge
glsl
shader
realtime
cell shading
toon shading
License(s): 
CC-BY 3.0
Collections: 
Favorites: 
3
Share Icons: 
Preview: 
Preview

Hello,

This .blend contains a outliner script that I wrote inspired by BsDev's blend on BlendSwap but I tried to improve it.

This python script use a Filter 2D actuator to active a GLSL shader that is wrote on a string. The python part include parameters on the string. Parametrers are tickness and intencity of the line. Tickness is calculate with the current window size because the GLSL function used take percent of the current window size as argument.

EDIT 10 feb 2014 : New cleaner outline method. Now the outline is of the given color when the pixel color difference is greater than a given value. It remove transparency and darkening of faces and edges.

 EDIT 26 apr 2014 : I've removed the substitue function to use the % operator that is built-in and I've discoverd recently.

File(s): 
cell_shading.blend cell_shading.blend 661.9 Kb [213 download(s)]
  • Log in or register to post comments

Comments

gregkwaste
joined 11 years 3 months ago
02/10/2014 - 10:07

Magnificent job mate, my aim is to enable that while an object is selected, more like a separator and i would like to know if there is any way to change the outline color.

I read your code and i think that it will always lead in a black color. Can you give me any type of advice? Thanks alot

Greg

  • Log in or register to post comments
WorkInProgress
joined 11 years 11 months ago
02/10/2014 - 11:42

Hello,

First thanks, you inspire me and i updated the file.

For the selection i thinks it's impossible to outline a single obetc because it's a pixel shader so you can't diferentiates objects.

For the color see the new file, i add a color parameter with the new method. You were right, the old method doesn't allow you to change color.

  • Log in or register to post comments
gregkwaste
joined 11 years 3 months ago
02/10/2014 - 11:45

You are both fast and genious mate, thanks a lot, will study the new version :D

I have no experience in vertex shader nor in opengl so i can't even think on the modification myself :D

  • Log in or register to post comments