textures

Three.js - Can't Load A Texture

僤鯓⒐⒋嵵緔 提交于 2021-01-29 18:10:21
问题 So all I want to do is grab a texture that I have saved in a folder. The error I'm getting is: "GET file:///E:/Html/Expo%20Sites/Good%20Site/tex/dirt.jpg net::ERR_FILE_NOT_FOUND" I'm getting the texture, putting it in a variable, creating the geometry, creating the material, then creating the object and assigning the material to it. I'm new to the Three.js library so I might be missing something really obvious. Here's the code if you wanna have a look. var mousePos = {x: 0.0, y: 0.0}; var

THREE.CanvasTexture needsUpdate no helps

可紊 提交于 2021-01-29 07:17:04
问题 I have video tag and he plays simple video. [works] I have canvas2d with playing same video [works] opencvjs video processing (canvas is output , video is input)- also works I have three.js with plane mesh texture = new THREE.CanvasTexture(this.$refs.testcanvas) texture.needsUpdate = true; materialLocal = new THREE.MeshBasicMaterial({ map: texture }) materialLocal.needsUpdate = true; materialLocal.map.needsUpdate = true; this.mainVideoMesh.material = materialLocal this.mainVideoMesh.material

Get access to later versions of GLSL

心不动则不痛 提交于 2021-01-28 21:07:16
问题 I was making a shader with GLSL so I could apply texture arrays to a cube when I ran into an issue. The issue was that layout wasn't supported in the version I was using. Easy fix, use a later version, but the problem with that was that I don't have support for later versions that support layout . I was wondering, is it possible to get support for later versions of GLSL, and if so, how would I do such a thing? This is my current GLSL code for applying textures Vertex Shader: #version 130

Three.js Texture loading

心已入冬 提交于 2021-01-28 09:58:43
问题 I am starting during this days with Three.js and it's very cool. Now i would like to load a texture and apply it to a simple sphere. My problem is that when i open the browser page i get this error. I don't know how to solve this problem. Code window.onload = Init; var scene; var camera; var renderer; function render() { renderer.render(scene, camera); requestAnimationFrame(render); } function Init() { scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera(75, window.innerWidth

I have a black texture

冷暖自知 提交于 2021-01-28 09:09:51
问题 This is my first time working with textures in OpenGL, although I've been studying it for 4 months now. And when I try to load a texture (Just an image with a square) I get just a black square.\ My texture load code: byte[] pixelData = new byte[0]; try { BufferedImage bi = ImageIO.read(getClass().getResource(TEXTURE_FILES)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ImageIO.write(bi, "png", baos); baos.flush(); pixelData = baos.toByteArray(); baos.close(); } catch (IOException

How Can I Prevent Texture Bleeding When Using drawImage To Draw Multiple Images From A Tile Sheet, Sprite Sheet, Or Texture Atlas?

有些话、适合烂在心里 提交于 2021-01-28 05:38:00
问题 I am using the HTML5 canvas API to draw a tile map for a pixel art game. The rendered tile map is comprised of many smaller images that are cut out of a single source image called a tile sheet. I am using drawImage(src_img, sx, sy, sw, sh, dx, dy, dw, dh) to cut the individual tiles out of the source image and draw them onto the destination canvas. I am using setTransform(sx, 0, 0, sy, tx, ty) to apply scale and translation to the final rendered image. The color "bleeding" issue I need to fix

Resulting MTLTexture lighter than CGImage

若如初见. 提交于 2021-01-27 11:41:52
问题 I have kernel func which must convert Y and CbCr textures created from pixelBuffer(ARFrame.capturedImage) to RGB texture like in apple guide https://developer.apple.com/documentation/arkit/displaying_an_ar_experience_with_metal But I get over lighted texture kernel void renderTexture(texture2d<float, access::sample> capturedImageTextureY [[ texture(0) ]], texture2d<float, access::sample> capturedImageTextureCbCr [[ texture(1) ]], texture2d<float, access::read_write> outTextue [[texture(2)]],

Use different texture for specific triangles in VBO

拥有回忆 提交于 2021-01-27 05:06:20
问题 I have 9 quads made of triangles, like this: I'm using VBO to store data about them - their position and textures coordinates. My question is - is it possible to make the quad 5 to have a different texture than the rest of quads by using only one VBO and shader ? : Green color represents texture 1 and yellow - texture 2. So far I got: GLfloat vertices[] = { // Positions 0.0f, 0.0f, ... // Texture coordinates 0.0f, 0.0f, ... }; I'm creating VBO by using that vertices[] array, and then I'm

Use different texture for specific triangles in VBO

混江龙づ霸主 提交于 2021-01-27 05:04:45
问题 I have 9 quads made of triangles, like this: I'm using VBO to store data about them - their position and textures coordinates. My question is - is it possible to make the quad 5 to have a different texture than the rest of quads by using only one VBO and shader ? : Green color represents texture 1 and yellow - texture 2. So far I got: GLfloat vertices[] = { // Positions 0.0f, 0.0f, ... // Texture coordinates 0.0f, 0.0f, ... }; I'm creating VBO by using that vertices[] array, and then I'm

Texturing a cube with different images using OpenGL

不想你离开。 提交于 2021-01-05 07:32:39
问题 I have a project from school I'm currently working on and I need to texture a non-rotating cube showing just 3 faces. I've tried doing it on my own but I only get one image on all the 3 faces. I don't know if it's my method that's wrong or the way I'm loading the remaining two images. I would really appreciate help from anyone. This is how I load my textures GLuint VAO, VBO; glGenVertexArrays(1, &VAO); glGenBuffers(1, &VBO); glBindVertexArray(VAO); glBindBuffer(GL_ARRAY_BUFFER, VBO);