Jump to content
  • Advertisement
Sign in to follow this  
snaileri

Specular highlight on a 2D shape

This topic is 2342 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
What would be the fastest way to render a dynamic specular highlight (light reflection) to a 2D shape?
I'm talking about this effect:
jou8G.jpg

I have no idea how those are made, but in both examples the highlight moves dynamically along the surface of the shape.
Of course, as this is not a 3D mesh, but rather a flat object, none of the common shading algorithms ( http://en.wikipedia.org/wiki/List_of_common_shading_algorithms ) work here.

I couldn't find anything helpful though Google as I don't know the name the effect.

Share this post


Link to post
Share on other sites
Advertisement
Well, flat objects don't have specular highlights like that.

Now, if you are talking about a 3d object thats being represented by a 2d sprite, then you simply normal map it and shade it like normal http://en.wikipedia.org/wiki/List_of_common_shading_algorithms

Share this post


Link to post
Share on other sites
I have to stick with a 2D mesh, so I have to find a way to fake the effect. Edited by pekhe

Share this post


Link to post
Share on other sites

I have to stick with a 2D mesh, so I have to find a way to fake the effect.


You allready did get answer how to fake it. Use normal map. You can simplify the process becouse you don't need to care about tangent space or such. Just use object space normal map and transform lights to object space and done.

Share this post


Link to post
Share on other sites
even if your shape is 2d, you can usually create a height map. simplest one is by using the alpha map (white for visible, black of transparent) and do a Gaussian blur.
once you have the height map, you can do emboss bump mapping, to have a specular highlight, you just need to remap your linear intensity to some curve.

that's how we were doing it back then, on amiga etc.

this one has some nice pictures that explain it on high level:
http://www.tweak3d.net/articles/bumpmapping/

simple tutorial
http://www.delphi3d.net/viewarticle.html

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!