Jump to content

  • Log In with Google      Sign In   
  • Create Account


Specular highlight on a 2D shape


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 pekhe   Members   -  Reputation: 136

Like
0Likes
Like

Posted 14 July 2012 - 04:09 PM

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:
Posted Image

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.

Sponsor:

#2 Chris_F   Members   -  Reputation: 1937

Like
1Likes
Like

Posted 14 July 2012 - 04:30 PM

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

#3 InvalidPointer   Members   -  Reputation: 1364

Like
0Likes
Like

Posted 15 July 2012 - 07:02 AM

shade it like normal

I see what you did there!

(Also your advice is bang on the money.)
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.

#4 pekhe   Members   -  Reputation: 136

Like
0Likes
Like

Posted 15 July 2012 - 08:26 AM

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

Edited by pekhe, 15 July 2012 - 08:27 AM.


#5 kalle_h   Members   -  Reputation: 1273

Like
0Likes
Like

Posted 15 July 2012 - 08:35 AM

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.

#6 Krypt0n   Crossbones+   -  Reputation: 2282

Like
1Likes
Like

Posted 16 July 2012 - 03:13 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS