Recent

Author Topic: Normal map in LazPaint  (Read 8810 times)

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Normal map in LazPaint
« on: April 19, 2014, 01:21:22 pm »
Hi,

There will be usefull to have a Normal map filter in LazPaint.
something like this: http://www.smart-page.net/smartnormal/

This is used to enhance the depth in textures used in 3D models, for example in Blender Render or Blender Game:
http://www.youtube.com/watch?v=suiElDMB_1I (the photoshop plugin from NVIDIA is outdated, it does not work with latest version).

The occlusion map can be done changing saturation and brightness that already can be done in LazPaint.

CaptBill

  • Sr. Member
  • ****
  • Posts: 435
Re: Normal map in LazPaint
« Reply #1 on: April 19, 2014, 05:55:44 pm »
Even better would be to simply compute your 3d (X,Y,Z) points into 5d points (X,Y,Z,A,B). If you have two 3d points you can compute the 4th and 5th axis (A,B). This is not filtering but adding new data.

If you can add this data to a spline/bezier curve, so you can 'serialize' the points array of the curve and also have the normals then you will have some serious drawing capabilities.


Carver413

  • Full Member
  • ***
  • Posts: 119
Re: Normal map in LazPaint
« Reply #2 on: April 19, 2014, 06:40:19 pm »
Even better would be to simply compute your 3d (X,Y,Z) points into 5d points (X,Y,Z,A,B). If you have two 3d points you can compute the 4th and 5th axis (A,B). This is not filtering but adding new data.

If you can add this data to a spline/bezier curve, so you can 'serialize' the points array of the curve and also have the normals then you will have some serious drawing capabilities.
not really understanding this, can you provide more info ?

CaptBill

  • Sr. Member
  • ****
  • Posts: 435
Re: Normal map in LazPaint
« Reply #3 on: April 19, 2014, 08:27:57 pm »
Even better would be to simply compute your 3d (X,Y,Z) points into 5d points (X,Y,Z,A,B). If you have two 3d points you can compute the 4th and 5th axis (A,B). This is not filtering but adding new data.

If you can add this data to a spline/bezier curve, so you can 'serialize' the points array of the curve and also have the normals then you will have some serious drawing capabilities.
not really understanding this, can you provide more info ?

I'll try. Take a look at this and think of how simple it is to make one of these:
http://cdn-s3-2.wanelo.com/product/image/2656468/original.jpg

It's just points placed on two axes with lines drawn point to point, which forms nice 'beziers'. The intersection points of two adjacent lines gets X and Y. While you are there, you can compute the angle which is the A axis computation. Should be a one-liner piece of code. If you can do that, compute the X,Y,A then full 5d can be had by combining 'beziers', (X,Y)+(X,Z)+(Y,Z).

We need a much simpler bezier which uses the same building technique as they use in string art. You have 2 lines and put tacks ever n points on the line. string the 'lines' in an ordered fashion around the tacks.

Code: [Select]
function makenewbezier(point1, point: Tpoint; resolution:integer):TNewBezier; //includes 3rd,computed 'A' dimension

Now take three of these beziers, and you can compute in 5d on a transformation grid, as if it were a 2d grid. So to do something fancy like draping a photo on the grid will be rather trivial, and surprisingly simple.

I hope I conveyed how simple this should be. I think it's the bare-metal 'bezier' that should provide these capabilities vs. 'filtering' much later in the game. More control of the 'basis curves' , in a more intuitive way, should make for easier 'filtering' as well.




Carver413

  • Full Member
  • ***
  • Posts: 119
Re: Normal map in LazPaint
« Reply #4 on: April 20, 2014, 04:06:14 pm »
I like the picture, kind of a lost art. I haven't seen one of those for many years. your Idea sound interesting but I am still a little vague as to how to use it. I had thought of using bezier to create pressure sensitive lines where the brush size would grow or shrink depending on the pressure  level. I'm going to play around with this string art thing, seeing it has given me a few Idea's of my own.
thanks

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Normal map in LazPaint
« Reply #5 on: April 20, 2014, 05:14:11 pm »
Ok.

Basically is for using it in Blender (it combines uv texture, normal, displacement, specularity and occlusion maps http://en.wikipedia.org/wiki/Normal_mapping#See_also)
http://www.blenderguru.com/videos/the-secrets-of-realistic-texturing/

But seems that Blender has something like that internally
http://thezedlab.com/quick-reference-baking-normals-from-a-bump-map/
« Last Edit: April 20, 2014, 05:30:56 pm by 007 »

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: Normal map in LazPaint
« Reply #6 on: April 21, 2014, 01:25:11 pm »
It looks a bit like the emboss filter, doesn't it?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Normal map in LazPaint
« Reply #7 on: April 21, 2014, 03:04:55 pm »
It looks a bit like the emboss filter, doesn't it?

yes, of course the difference is in the colours that handle the direction of the depth in x y and z. unlike bump maps that only handles with a grayscale the depth. (or at least I understand that)..

the real way to create a normal map is 'baking' a high poly mesh and then using the generated normal map within the texture

but reading more seems that blender only can create normals from a bump map (in addition to baking a high poly).. but that is not cool, is better to generate it from a texture..?

you know, I think the best thing is to use the high poly, load the texture, using a displacement map.. and then by-hand sculpting the depth, but games doesn't think the same, high poly takes much more memory and cpu usage..

instead of using a lot of polygons for creating a floor texture, you can use only 4 to create the mesh, and apply the normal map

there is a plugin for gimp, but i've not tested it.

btw if this is not usefull for bgrabitmap in general use your time for another usefull thing

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: Normal map in LazPaint
« Reply #8 on: April 21, 2014, 09:43:27 pm »
I don't know if that's what you are talking about, but the phong rendering in BGRABitmap works with a height map, and from there it computes 3d normals that are combined with the light source. But are you interested in obtaining a map of vectors that are normal to the surface, or a map with a height? And from what information, an 2d colored-image? So from a contour/emboss filter?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Normal map in LazPaint
« Reply #9 on: April 22, 2014, 02:24:47 am »

Don't worry i've solved my problem now i have the tools to do it.

« Last Edit: April 22, 2014, 03:04:34 am by 007 »

circular

  • Hero Member
  • *****
  • Posts: 4221
    • Personal webpage
Re: Normal map in LazPaint
« Reply #10 on: April 22, 2014, 09:19:01 pm »
Alright  8-)
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018