ILLUMM Posted January 27, 2015 Share Posted January 27, 2015 Anybody know how to create Du/Dv renders on Paint.NET? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted January 27, 2015 Share Posted January 27, 2015 Example? Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 27, 2015 Share Posted January 27, 2015 I suspect this sort of thing: http://wiki.polycount.com/wiki/DuDv_map How about these Water Reflection or Waves or Wet Floor Reflection? Also this: http://forums.getpaint.net/index.php?/topic/14278-texturize-effect-plugin/ Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
MJW Posted January 27, 2015 Share Posted January 27, 2015 You need two images, so it would be a lot easier if Paint.NET allowed plugins to read other layers. You can use the clipboard, kludgy as that is, or in some cases mathematically generate the displacement for each pixel. Once you have the image you want to distort and the displacement map, use GetBilinearSample to distort the image with the displacements. For example, if the displacements are (somehow) stored in the green and blue channels of the dst image, it would look something like this: for (int y = top; y < bottom; y++) { if (IsCancelRequested) return; for (int x = left; x < right; x++) { float dX = gradScale * (float)(dst[x, y].G - 127); float dY = gradScale * (float)(dst[x, y].B - 127); dst[x, y] = src.GetBilinearSample(x + dX, y + dY); } } } Quote Link to comment Share on other sites More sharing options...
MJW Posted January 28, 2015 Share Posted January 28, 2015 Suppose you want to render the image as if it were reflected in a surface perpendicular to the eye vector. To make it easier, assume the eye vector is a directional vector (the eye point is at infinity). At each pixel there are partial derivatives, Dx and Dy, for the reflecting surface, either computed analytically or from finite differences. For any k, let t = k / (1 - Dx * Dx - Dy * Dy). Then (x', y') = (x - t * Dx, y - t * Dy). K is half the distance from the reflecting plane to the reflected image. If (1 - Dx * Dx - Dy * Dy) is less than or equal to zero, the reflection vector misses the image plane. (I hope I did the math correctly.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.