Search the Community

Showing results for tags 'texture'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 214 results

  1. Hi all, We with my colegue decided to share texture generator node-js tool that we created. Its port of compresed texture generator script to node, so it can be used cross platform not just on win machines, also included in build scripts. NPM: GIT: Feel free to post issues and suggestions on github. More information is located inside file.
  2. Hello, I have a little Problem with my Mirror Material. I cant get the Blur to work. If I try to blur the reflections in this playground Example by adding the lines: mirrorMaterial.reflectionTexture.blurKernel = 64; mirrorMaterial.reflectionTexture.blurRatio = 1; everything works fine. But If i try it in my own Scene nothing happens (changing the Values has zero Effect). Does anybody have an idea why it works in the playground but not in my scene?
  3. Hi Everyone, I need guidance on how can I approach this problem: Would like to apply a tiled texture to complex polygons. I'm using P2 for the physics and tiled for the level editor. I would like to get something similar to worms where the terrain has a tiled texture, the top has grass and the bottom is darker. These are some examples of what I would like to achieve: I don't care at all about destructible terrain. This is how my level looks now with polygons from tiled:
  4. Is there a way to change texture uOffset and vOffset without having the texture smearing? You can see it here
  5. I've noticed when scaling textures with uScale and vScale it does it from the corner. Is there a way to scale from the centre, so it really looks like you're zooming in? Here's a playground to demonstrate how it scales from the corner:
  6. Are there any examples of how to apply a texture to an individual vertex as is described in this tutorial:
  7. Hi folks, I am a beginner for babylon.js and blender. So I imported a cube with one face textured from blender to babylon js using BABYLON.SceneLoader.Load. The scene has the default point light in blender and the HemisphericLight I created using babylon.js. Everything looks good (please see the 2.jpg in the attachment), but after I resize the cube to make the cube flat (using cube.scaling.y = 0.1), the lower part of the textured face will be always shadowed, no matter how i adjust the light or how to move the cube (please see the 1.jpg). I already made the scene as simple as possible to narrow down the cause of the issue, but I still cannot figure out why the lighting cannot be rendered properly. So any help will be much appreciated!
  8. Hy everyone! I'm making a game and need a little help with the transparency stuff. So, in the game I have one material that has a texture (a png image that contains transparent parts). The mashes are made out of planes, merged together and the planes shows parts of the texture (think about it like Minecraft). I can set the colors of each plane in the mesh with the colorKind vertexdata.. except the alpha part. So I tried to find some topics about it and saw somewhere a tip to set the hasVertexAlpha on the mesh to true and add the texture to the opacityTexture. That worked, now I can set the RGBA on any parts of the mesh but the rendering order goes wrong Here's an image: the red and the green are one mesh (that has two planes, the green is above the blue), the blue is the other mesh. The green is half transparent using the colorKind alpha : It's cool, this is the result I'm looking for! But when I rotate the camera, the blue is displayed above the green. And here is playground link to what I'm experiencing in the game: So in short, I want to have a material with a diffuseTexture that has transparent parts and use the colorKind RGBA on every plane in every mesh. What am I doing wrong and how can I fix it? Thanks for the help!
  9. I want to draw a texture on the line that user draws on the screen. Like a mouse trail, so I follow this tutorial. . The only thing that doesn't answer me is sending the custom uv to the shaders. I vaguely remember that in C++, I can create struct or something and the shader will know how to handle it. It seems that is not the case here. I can't even figure out how does "index" property in vertex shader gets there. Even so, I can't use the "index" approach as the line won't be full rectangle as in the example. Right now, I copied & pasted the entire lines2d classes and try to customize to be able to draw texture on there, but I don't know how to send the custom uv that I've calculated to the shader. Anyone can explain that to me? Or am I looking at this a wrong way?
  10. Hi All, plz. help me with this issue. I'm applying a texture mapping to an object, but it turns out to be multicolors on the surface. see the below left picture shown(desk and sofa). I wonder if it's caused by binary file? Coz when I set binary false, it worked as the mapping picture I wanted(see below right picture). What can I do if I want to use binary file while showing the correct mapping on object. Thanks in advance.
  11. Hi! I am a newbie to babylon js, and I already have problems. I have loaded textures to my object (stick/bar) and problem is when I resize my object, texture resizes too. I tried to apply texture after scaling object, but texture resizes anyway. I really don't want to create a new texture for every object just because its size changes. So, my questions are: Is there a way in babylon js to set its size to be fixed? Or is there a way to set texture to repeat itself rather than scale itself to wrap the object. Image is attached (mind the upper bar is longer and its texture is scaled <-- that's my problem).
  12. Does anyone know why the edges of my transparent texture have red lines on it? Is there a way to prevent it from happening?
  13. Hi, I have exported model from 3dmax and loaded in babylon and meshes are cloned after load (also tried instance). But sometimes some meshes appear in scene with default color not with texture, but after changing angle of camera (ArcRotateCamera) some of them get texture back. I will try to isolate problem but meanwhile maybe someone seen similar behaviour? I use alpha version of babylon from npm. Thanks.
  14. Let's say I have a material with the following properties: var ref = new BABYLON.CubeTexture("skybox", scene); var mat = new BABYLON.PBRMaterial("PBR", scene); mat.albedoTexture = new BABYLON.Texture("a.png", scene); mat.reflectionTexture = ref; mat.microSurface = .4; //mat.diffuseTexture = new BABYLON.Texture("s.png", scene); //mat.reflectivityColor = new BABYLON.Color3.FromHexString("#eeeeee"); //mat.albedoTexture.hasAlpha = true; //materialGloss.albedoColor = new BABYLON.Color3.FromHexString("#f00001"); Is it possible to have a texture on top of the reflecting surface? Preferably with an alpha channel. What about multiple textures layered on top of each other, like a dirt map on top of a logo?
  15. Trying to help this topic The problem is scaling texture on the caps of an extrusion. What is needed is something like this on the caps what I get is any suggestions
  16. when exporting my model to .babylon (using blender) it gives this error "RuntimeError: Error: Maximum number of textures added 18" the model export correctly but some textures are missing. Can anyone help me ?
  17. Hi, I was wondering if someone had experienced slight differences in "offsets" using sprite2D texture and wether it might be related to caching. As an example I have a fairly small texture of 16*16 here in svg, but i tried also using png, same problem. That's the begining of the sprite texture zoomed in 4800% When using it in chrome with a code like this: const crossSheet = taskObject.cloneAssetIntoScene(R.get.crossSheet, scene) crossSheet.hasAlpha = false const cross = new BABYLON.Sprite2D(crossSheet, { parent: canvas, id: 'cross', marginAlignment: 'v: center, h: center', spriteSize: new BABYLON.Size(16, 16), spriteLocation: new BABYLON.Vector2(0, 0), }) cross.spriteFrame = R.get.cross_predict The texture is at the center of the screen here, in chrome the top misses 0.5px In Safari there is a difference in colors and width of strokes: If now I am using a 16,17 sprite size i get a correct sprite in chrome: But somehow it is seems worst in safari: Any clue ? Do you think it is related to the caching strategy ? @Nockawa Here is the link to the texture: Here is a playground, on the playground it is the BOTTOM 0.5px that get cutoff..
  18. Hello everyone, First time using Phaser, and I'm trying to add a tileSprite to the game using a texture generated by Pixi. But I'm getting the following warnings and errors: Warning - Phaser.Cache.getImage: Key "__default" not found in Cache. Warning - phaser.min.js:3 Phaser.Cache.getImage: Key "__missing" not found in Cache. Error - phaser.min.js:3 Uncaught TypeError: Cannot read property 'base' of null at new c.TileSprite I discovered that the error disappears when I add a preload method, load any image, even an image that does not exist. By doing this, the tile appears normally and the erros desappears. Can anyone tell me what's going on? I need to use textures already loaded outside the Phaser. My Code(.coffee) @_game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, @element, preload: @_preload create: @_onPhaserCreate update: @_onPhaserUpdate render: @_onPhaserRender) _preload:()=> @_game.load.image('load-nothing', ''); _onPhaserCreate:()=> @_game.physics.startSystem(Phaser.Physics.ARCADE); @_background = new PIXI.Texture(new PIXI.BaseTexture("image_element")) @_stars = @_game.add.tileSprite(0, 0, window.innerWidth, window.innerHeight, @_background) _onPhaserUpdate:()=> # _onPhaserRender:()=> #
  19. i have problem with texture when i convert obj file to babylon using blender software ,i get noise textures and it add a new texture called "NORMALS" here the original texture and the noise one
  20. Hi! How I can create paticleSystem with subPicture fromTextureAtlass? In past I used texture atlases for Sprite2D, but now I have many textures for my particles systems and I want combine all my textures in one big textures, but how I can get subTexture from my big atlas texture or it is imposible and atlases using only for Sprite2D? Thank for any information :)
  21. Hello everyone, I'm currently doing some tests with the DynamicTexture system that could be used to add a new tutorial. The final goal is to have one picture on a plane. When I click on some button I will activate an animation managed by Babylon (if it's possible) so I can fade in and fade out the pictures. I had a first method where I wanted to add a canvas inside the canvas but that didn't work out : Now I have one texture fading in and fading out automatically : To be continued...
  22. Hi, I tried to generate textures with PVRTexToolCLI but 2 were not done (astc and dxt). Astc was not created without error (junk.txt was created) but dxt said that format BC1 or BC2 is not found (I checked with -help supported formats and they really were not in the list). I am using mac so probably they are win only?
  23. I am creating animation frames from image the hard way -I am using PIXI.Texture and passing baseTexture and Rectangle (I don't use json directly, because of reusability of json instructions). See code below. I am getting an error: baseTexture.once is not a function. I don't know what is causing this error, but the animation is working as expected. Is this error something I shouldn't worry? function loadAssets() { PIXI.loader .add('first', 'assets/first.png') .load(function (loader, resources){ onLoaded(loader, resources) }); } function onLoaded(loader, resources) { console.log(resources.rot1.texture.baseTexture);// all rotations loaded var first = new PIXI.extras.AnimatedSprite(createFrames(resources["first"].texture.baseTexture)); .... } function createFrames(name) { var frames = []; for (var i = 0; i < 39; i++) { var rect = new PIXI.Rectangle(arr[i].frame.x, arr[i].frame.y, arr[i].frame.w, arr[i].frame.h); // stored in an array generated from json frames.push(new PIXI.Texture(name, rect)); } return frames; }
  24. It's a pleasure to announce a texture generator "TexGen" to be used by BABYLON developers. Due to the excellent work of @NasimiAsl 's ShaderBuilder it's possible to build a somewhat generic shader and inject the runtime properties (uniforms) on the fly. I've designed a shader-script which takes altenative inputs, generates artificial normal maps, mixes with another optionally image and outputs a really nice 3D look of the (flat) inputs. Live system available HERE (updated) Key featuers: Alternative input sources: PatternGenerator, NoiseGenerator and plain image No need for normal maps, they will be generated on the fly by the shader pattern generator on the javascript side, once generated => turbo speed on the shader side noise generator on the javascript side (Perlin,Fractal,Turbulence), once generated => turbo speed on the shader side Preset concept, all shader/pattern/noise-parameters can be reduced to a handful numerical settings (JSON-Format) Full procedural, images can be mixed optionally Here are some preset patterns from the noise generator and some other Examples. I hope you find this interesting... Greetings, javalang PS. a short description to the LIVE-System (from right to left): on the upper right you find a slider with three input-sources. The next menu are the properties for the pattern generator. On thenext menu are the shader properties mainly for the normal map creation and a slider "balance" where you can mix another image to the input. And on the left side is the noise menu (I prefer preset9 ), there are endless more to be detected... Full procedural image with noise: Mixed with another image: Input source: single image! Input source: pattern generator Noise mixed with image:
  25. I have made a demo that the sprite will scale to a bigger size on some event. However its texture gets blurry and resolution changed so the sprite looks very awful after scaling to a bigger size. Is there a way to scale but maintain the visual quality of the texture without changing the resolution of the texture? How about replacing the texture with a new one? This is all I can think about but I am afraid of the performance cost. I am using CanvasRenderer by the way.