bump-mapping

Bump Mapping with javascript and glsl

拜拜、爱过 提交于 2020-08-20 06:32:28
问题 /** * A class creating buffers for a textured box to render it with WebGL */ class RasterTextureBox { /** * Creates all WebGL buffers for the textured box * 6 ------- 7 * / | / | * 3 ------- 2 | * | | | | * | 5 -----|- 4 * | / | / * 0 ------- 1 * looking in negative z axis direction * @param {WebGLContext} gl - The canvas' context * @param {Vector} minPoint - The minimal x,y,z of the box * @param {Vector} maxPoint - The maximal x,y,z of the box */ constructor(gl, minPoint, maxPoint, texture)

Running normal maps / bump maps on Pixi.js

删除回忆录丶 提交于 2020-07-16 09:41:23
问题 I would really like to use normal maps in pixi.js but I don't know how. I've came across a good example with THREE.js and using webgl shaders - clickOnDemo (sometimes it's necessary to click once on the image to work). So I really wanted to replicate it but using pixi, I gave it a shot aand black screen - myDemo . I don't get errors and I'm not sure what I'm doing wrong. Could the problem be in the way I'm creating the mesh or the shader? var material = new PIXI.Shader.from(null, shaderCode,

Running normal maps / bump maps on Pixi.js

孤者浪人 提交于 2020-07-16 09:40:34
问题 I would really like to use normal maps in pixi.js but I don't know how. I've came across a good example with THREE.js and using webgl shaders - clickOnDemo (sometimes it's necessary to click once on the image to work). So I really wanted to replicate it but using pixi, I gave it a shot aand black screen - myDemo . I don't get errors and I'm not sure what I'm doing wrong. Could the problem be in the way I'm creating the mesh or the shader? var material = new PIXI.Shader.from(null, shaderCode,

Unity3D, round the edges of a box, cube?

筅森魡賤 提交于 2019-12-18 13:29:54
问题 What's the usual way to round the edges on a cube, a rectangular object as in the examples? The ideal result would look pretty much exactly like these images. (Naturally, you could literally use a mesh that has carefully rounded edges and corners, but it takes many tris to achieve that.) Note, of course for a NON -shader approach... Add two small flat boxes and simply make that new normal halfway, i.e., 45 degrees, between the two sides: That would be drawn perfectly round ... GDG below has

Bump-map a sphere with a texture map

自作多情 提交于 2019-12-17 17:23:51
问题 We would like to bump-map a sphere with a texture map. However, the surface of the sphere has an area that is 10 times the area of the texture map(area for both in pixels). Describe different ways in which the texture map can be used for bump mapping. 回答1: usually rectangle texture is used for spheres texture (u,v) coordinates are used as angles for spherical coordinates. The result is that texels are bigger near equator and smaller near poles. At poles all the texels merge to single pixel.

Three.js ColladaLoader bumpScale/weighting? Way to adjust bump map intensity

给你一囗甜甜゛ 提交于 2019-12-12 05:53:16
问题 In the current ColladaLoader.js I don't see anything that reads or applies the Collada standard's "weighting" value (0.0-1.0) that indicates bump intensity or "bumpScale" in Three.js Phong material. I noticed that when I export my collada from Blender it picks up the bump materials instantly in three.js (which is amazingly simple - YAY!) but my materials always get an exaggerated bumpScale of default 1.0. It gives the materials an exaggerated bumpiness. I managed to edit my ColladaLoader a

2D Water Bump Mapping - Monogame

别来无恙 提交于 2019-12-11 18:45:55
问题 Thanks for taking the time to check out my issue. I am working on improving the ocean in my first attempt at a game. I have decided on a using a bump map against my ocean tiles to add a little texture to the water. To do this, I draw my water tiles to a renderTarget and then apply a pixel shader while drawing the render target to the backbuffer. The problem I am having is that the pixel shader seems to offset or displace the position of render target that is drawn. Observe these two photos:

Repeating a bump map

守給你的承諾、 提交于 2019-12-09 19:22:36
问题 I'm trying to apply a bump map to a plane to create a vaguely felt-like surface using Three.js r55. Here's my code: var mapHeight = THREE.ImageUtils.loadTexture("images/felt.png"); mapHeight.repeat.set(2, 2); mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping; mapHeight.format = THREE.RGBFormat; var groundMaterial = new THREE.MeshPhongMaterial({ ambient: 0x008800, color: 0x008800, specular: 0x888888, shininess: 25, bumpMap: mapHeight, bumpScale: 10, metal: false } ); scene.add(new THREE

JavaFX material's bump and spec maps

非 Y 不嫁゛ 提交于 2019-12-06 11:12:29
问题 When JavaFX8 code loads the color, bump and spec maps, the color and spec work as expected, but bump map is causing strange effects. All three are Mercator maps of Earth. Generally, there is no 3d effect added by the bump map. Bump map only causes Himalaya and Andes appear on the lit side of the globe as black areas with shiny border and on the shaded side as they appear on the color map. What am I doing wrong? Image diffMap = null; Image bumpMap = null; Image specMap = null; diffMap = new

JavaFX material's bump and spec maps

北慕城南 提交于 2019-12-04 15:37:45
When JavaFX8 code loads the color, bump and spec maps, the color and spec work as expected, but bump map is causing strange effects. All three are Mercator maps of Earth. Generally, there is no 3d effect added by the bump map. Bump map only causes Himalaya and Andes appear on the lit side of the globe as black areas with shiny border and on the shaded side as they appear on the color map. What am I doing wrong? Image diffMap = null; Image bumpMap = null; Image specMap = null; diffMap = new Image(MoleculeSampleApp.class.getResource("Color Map1.jpg").toExternalForm()); bumpMap = new Image