Author Topic: ALPHA: NPR-rendering in Freespace  (Read 1397 times)

0 Members and 1 Guest are viewing this topic.

Offline qazwsx

  • POST DRUNK GET TITLE
  • 29
ALPHA: NPR-rendering in Freespace
After playing around yesterday with GLSL for the first time,  I decided to have a look at the main-f.sdr shader, with a few simple adjustments, an almost cartoon-like effect can be achieved:




And one without ambient lighting, to show the full extent of the effect:

Model from Earth Defense

Mod to enable this shading style is attached, instructions included in readme.

http://www.mediafire.com/?j3cwolhwhju99ry
« Last Edit: March 22, 2011, 05:15:36 pm by qazwsx »
<Achillion> I mean, it's not like he's shoving the brain-goo in a usb slot and praying to kurzweil to bring the singularity

<dsockwell> idk about you guys but the reason i follow God's law is so I can get my rocks off in the afterlife

 

Offline redsniper

  • 211
  • Aim for the Top!
Re: ALPHA: NPR-rendering in Freespace
Eh... er... I mean... I'm not sure how that looks that much different from normal FS. Maybe I'm just blind. It's most apparent on the Herc I guess. Is there any way you could crank the effect up higher maybe?
"Think about nice things not unhappy things.
The future makes happy, if you make it yourself.
No war; think about happy things."   -WouterSmitssm

Hard Light Productions:
"...this conversation is pointlessly confrontational."

 

Offline qazwsx

  • POST DRUNK GET TITLE
  • 29
Re: ALPHA: NPR-rendering in Freespace
Two options, turn down ambient light and modify line 107 of main-f.sdr:

Code: [Select]
lightDiffuse += (gl_FrontLightProduct[i].diffuse * smoothstep(-0.05, 0.05, (dot(normal, lightDir))) * attenuation);
By changing the smoothstep values -0.05 and 0.05 so that they are closer together, i.e. -0.01 and 0.01 respectively, you can increase the sharpness of the terminator.

EDIT: Attachment has changed version, just needs to be renamed as a .sdr file as as I'm not able to upload them.

[attachment deleted by admin]
« Last Edit: January 05, 2011, 03:39:00 pm by qazwsx »
<Achillion> I mean, it's not like he's shoving the brain-goo in a usb slot and praying to kurzweil to bring the singularity

<dsockwell> idk about you guys but the reason i follow God's law is so I can get my rocks off in the afterlife

  

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: ALPHA: NPR-rendering in Freespace
Wait, what's that last fighter?
Something ED-exclusive?
(´・ω・`)
=============================================================

 

Offline qazwsx

  • POST DRUNK GET TITLE
  • 29
Re: ALPHA: NPR-rendering in Freespace
Yeah, I needed a smooth, rounded model to show the quick change in shading even across gently curving surfaces,  and it was the first one I had at hand, the GTC Sphere and GTD Torus were out of action.

One of the reasons that the effect is hard to see is that I'm just using it over the mediaVPs, it works best with smooth models, with weak normal maps so the change-over isn't distorted too much.
« Last Edit: January 06, 2011, 02:30:20 am by qazwsx »
<Achillion> I mean, it's not like he's shoving the brain-goo in a usb slot and praying to kurzweil to bring the singularity

<dsockwell> idk about you guys but the reason i follow God's law is so I can get my rocks off in the afterlife