|
From: Douglas M. <dou...@gm...> - 2011-04-06 22:07:23
|
I'm clearly unlearned in this field! However, I do believe this approach would allow gnuplot to accomplish flat shading (http://en.wikipedia.org/wiki/Phong_shading). Flat shading is more than enough for bump maps when the resolution of the input data is high enough, or interpolated sufficiently. I love the simplicity and specificity of gnuplot, and would never ask that it become some virtual reality rendering tool. However, bump maps are exceedingly useful in certain applications, for instance when conveying terrain or a potential surface (I can share a paper), so having complete control over both the color height function and the lighting (i.e., angle and harshness) would be prized. In these applications, the resolution of the input data is usually greater than what you actually plot. If you have any more input it would be greatly appreciated! On Wed, Apr 6, 2011 at 5:34 PM, Ethan A Merritt <sf...@us... > wrote: > Douglas Mason <dou...@gm...> wrote> > > > > Let's say you have a surface. It should be trivial to calculate the > gradient > > at any point in the surface by simply calculating the difference to each > > neighboring point. > > Not exactly trivial, but yes it could be done. > > > Based on the technique of normal maps, you can create a function that > simply > > adds or subtracts light (i.e., each RGB channel in unison) based on the > > angle of the gradient. Or simply provide said normal map which has its > own > > uses. > > I take it you are thinking of Gouraud shading, but that's not how it works. > The normal at each vertex is used to calculate a different shading at each > pixel within the face bounded by those vertices. But gnuplot cannot draw > pixel-by-pixel; it draws the entiry face in one go. So differential > shading > across the face is not possible. > > > This would permit a perfectly usable bump map in gnuplot > > A bump map is something else again. But again this results in a per-pixel > color distinction. So - nice idea, but not in gnuplot. > > Ethan > |