|
From: Daniel J S. <dan...@ie...> - 2011-04-07 07:08:42
|
Douglas, Could you create an example of what you have in mind using gnuplot with external data? E.g., take some sample data to create a normal shading. Then compute the gradients with some other program and create another plot for that data. All we would need is the two data sets and the commands to create the plots. Dan On 04/06/2011 05:06 PM, Douglas Mason wrote: > 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 >> > -- Dan Sebald email: daniel(DOT)sebald(AT)ieee(DOT)org URL: http://www(DOT)dansebald(DOT)com |