Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411656 Posts in 69395 Topics- by 58451 Members - Latest Member: Monkey Nuts

May 15, 2024, 03:32:08 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Fine line technical drawing shader?
Pages: [1]
Print
Author Topic: Fine line technical drawing shader?  (Read 1110 times)
GMacD
Level 0
**


View Profile WWW
« on: November 01, 2014, 08:47:52 AM »

I saw a lovely screenshot on twitter.

Anyone know of a shader which would do something like this?

I'm thinking of a technical drawing style - thin, sharp lines for outlines (of flat multi-triangle polygons - not triangles), otherwise flat shaded.

A bit like Sketchup I guess.

Thanks!
Logged

Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #1 on: November 01, 2014, 10:20:06 AM »

This topic might be a great place to ask Wink

http://forums.tigsource.com/index.php?topic=37314.400
Logged

GMacD
Level 0
**


View Profile WWW
« Reply #2 on: November 01, 2014, 10:52:49 AM »

This topic might be a great place to ask Wink

http://forums.tigsource.com/index.php?topic=37314.400

You know, I think you might be onto something... Smiley
Logged

Columbo
Level 0
***


View Profile
« Reply #3 on: November 01, 2014, 11:45:33 AM »

You could look into edge detection shaders, perhaps?
Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #4 on: November 01, 2014, 02:57:36 PM »

Even better, he wrote some blog posts about it.
Logged
Thomas Hiatt
Level 0
***



View Profile
« Reply #5 on: November 01, 2014, 05:58:45 PM »

A method that should work perfectly for all edges would be to use a geometry shader and generate the black edges based on triangle adjacency info. You can check the normal of the current triangle and the normal of the adjacent triangles and draw the outlines if they are different. I think this would probably be a lot slower than using edge detection algorithms but I am not sure. If you are going for flat shading and fairly low triangle counts then performance probably wouldn't matter too much.

This tutorial is a good starting point, just disregard the light and output edges based on the normals of the triangles.
Logged
GMacD
Level 0
**


View Profile WWW
« Reply #6 on: November 02, 2014, 11:11:47 AM »

A method that should work perfectly for all edges would be to use a geometry shader and generate the black edges based on triangle adjacency info. You can check the normal of the current triangle and the normal of the adjacent triangles and draw the outlines if they are different. I think this would probably be a lot slower than using edge detection algorithms but I am not sure. If you are going for flat shading and fairly low triangle counts then performance probably wouldn't matter too much.

This tutorial is a good starting point, just disregard the light and output edges based on the normals of the triangles.

That's a couple of options I've got now - thanks!
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic