Hi,
I was breaking my head to create a normal map programmatically. for one of my project i created black and white images from canvas and using that as alpha,bump displacement maps but i recently came to a requirement which i can fulfill if i can create a normalMap in the same way. but i could not figure out how to do that… is there any technique in three js itself ?
any help on this is highly appreciated.
Well, you can use a canvas as a data source for a texture. There is also a dedicated class for this use case: THREE.CanvasTexture.
However, the actual data generation of the canvas data is not something that three.js
can do for you. Meaning you have to generate the data by yourself and draw/put them onto the canvas.
thanks for your response…
yes i understand that part i was just curious anyone else tried this because i am not finding how the color values should be. for bump map it is easy that its just black and white. was wondering is there any easy way.