Line 1: Line 1:
 
Generation of animated normal maps using processing, experimentation phase.
 
Generation of animated normal maps using processing, experimentation phase.
  
[[File:Normal map generated with processing.png|200px]]
+
Demo in blender.
  
 
<html><iframe src="https://player.vimeo.com/video/249526108?title=0&byline=0&portrait=0" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></html>
 
<html><iframe src="https://player.vimeo.com/video/249526108?title=0&byline=0&portrait=0" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></html>
 +
 +
First generated file.
 +
 +
[[File:Normal map generated with processing.png|200px]]
 +
 +
== Code ==
 +
 +
To achieve the "engravement" effect, rectangles must be drawn using the following rule:
 +
 +
* a straight surface has no X or Y slope of 0°, its color is thus '''RGB'''( 127, 127, 255 )
 +
* angles in X and Y are limited to the range [-90°, 90°], represented as the color range [0, 255].
 +
* therefore, an angle of -45° on X is represented by the red value 64, by making 127 - 63
 +
* to draw an engraved line, you need to take into account the direction of the line, as it will influence the X and Y slopes.
 +
 +
[[File:Normalhow01.jpg|300px]]
 +
 +
thanks to [http://online.ts2009.com/mediaWiki/index.php/Normal_map Trainz Wiki] for this very usefull schema!
  
 
== References ==
 
== References ==
 
* http://online.ts2009.com/mediaWiki/index.php/Normal_map
 
* http://online.ts2009.com/mediaWiki/index.php/Normal_map
 
* https://www.katsbits.com/tutorials/textures/making-normal-maps-from-photographs.php
 
* https://www.katsbits.com/tutorials/textures/making-normal-maps-from-photographs.php

Revision as of 16:13, 3 January 2018

Generation of animated normal maps using processing, experimentation phase.

Demo in blender.

First generated file.

Normal map generated with processing.png

Code

To achieve the "engravement" effect, rectangles must be drawn using the following rule:

  • a straight surface has no X or Y slope of 0°, its color is thus RGB( 127, 127, 255 )
  • angles in X and Y are limited to the range [-90°, 90°], represented as the color range [0, 255].
  • therefore, an angle of -45° on X is represented by the red value 64, by making 127 - 63
  • to draw an engraved line, you need to take into account the direction of the line, as it will influence the X and Y slopes.

Normalhow01.jpg

thanks to Trainz Wiki for this very usefull schema!

References

online identity ∋ [ social ∋ [mastodon♥, twitter®, facebook®, diaspora, linkedin®] ∥ repos ∋ [github®, gitlab♥, bitbucket®, sourceforge] ∥ media ∋ [itch.io®, vimeo®, peertube♥, twitch.tv®, tumblr®] ∥ communities ∋ [godotengine♥, openprocessing, stackoverflow, threejs]]