franck22000 Posted September 16, 2011 Share Posted September 16, 2011 Here is a new shader that i made for LE, Pencil Drawing Shader Just put this piece of code in the postfilter.frag shader in the end of the main() function just before "gl_FragColor = outputcolor;" float dpt=0; dpt+=texture2D( texture1, texcoord + vec2( 0, pixelsize.y * 2.0 )).x; dpt+=texture2D( texture1, texcoord - vec2( 0, pixelsize.y * 2.0 )).x; dpt+=texture2D( texture1, texcoord + vec2( pixelsize.x * 2.0, 0 )).x; dpt+=texture2D( texture1, texcoord - vec2( pixelsize.x * 2.0, 0 )).x; dpt/=4; if ((depth-dpt)>0.0001) { outputcolor=vec4(0.05,0.05,0.05,1.0); // Edges color } else { vec4 c = texture2D(texture0,texcoord); c += texture2D(texture0, texcoord+0.001); c += texture2D(texture0, texcoord+0.002); c += texture2D(texture0, texcoord+0.003); c += texture2D(texture0, texcoord+0.004); c += texture2D(texture0, texcoord+0.005); c += texture2D(texture0, texcoord+0.006); c.rgb = vec3((c.r+c.g+c.B)/2.0); vec4 graycolor = vec4(0.15,0.15,0.15,1.0); outputcolor=c*graycolor; } Quote You guys are going to be the death of me. Josh Link to comment Share on other sites More sharing options...
puki Posted September 16, 2011 Share Posted September 16, 2011 It would be awesome if it didn't lose detail/definition (if you get what I mean). Quote Link to comment Share on other sites More sharing options...
knowledgegranted Posted September 18, 2011 Share Posted September 18, 2011 This is very cool, and I'm glad you posted this here; it just gave me a great idea for a game. Quote It's like JFK announcing the moon mission. He had no expertise in space travel, and no way of knowing if it would work. He just announced "we're going to the moon" and then they made it happen because everyone was on the same page and working towards the same goal. If he had said "well, let's get some people in space, and we'll see how far out we can get, and if I find someone to make a rocket strong enough, we could possibly approach the moon's orbit and maybe land" it wouldn't have happened. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.