Search the Community
Showing results for tags 'cut'.
Found 3 results
This topic is a bit similar to an old topic of mine "Real 3D Mask", only this time I know a little more what I need and how I need it. I created a box mesh. I'd like to create a shader in which I can specify the y of 2 lines: -top line - nothing above it is drawn -bottom line - nothing below it is drawn The areas above the top line or below the bottom line should be "cut" in a 3d way, a 2d mask or anything of the sort will have a bad looking result. I added a sketch to demonstrate how the result should look like. Second picture from the left - Red parts are either above top line or below bottom line and shouldn't be drawn, green part should be drawn. From what I understood from the previous topic ("Real 3D Mask"), it should be pretty simple, just check in a vertex shader if the current pixel is above the top line or below the bottom line, and if so, discard it. As simple as it is, I have no idea how to do it, as I'm clueless when it comes to shaders. Here's a link to the old Playground (by @NasimiAsl), please don't use it, it's just to remind you of a similar solution so we don't start from scratch. http://www.babylonjs-playground.com/#QHMT1#7 For this topic I created a new playground: http://www.babylonjs-playground.com/#1IUU00#0 I'd like to save the shaders via ShadersStore, please no ShaderBuilder or anything else. Can you please help me write this shader? I'd be twice more grateful if you'll help me understand what you write.
Hello! I have a simple problem - my text started to get cut off after I downloaded a newer version of Phaser. That version uses a newer Pixi.js too, so maybe the problem lies there? I simply tested with the older version, then changed the file and tested with the other - I'm sure the problem is not in my code. Sometimes, the same thing happens to the right side of the text as well. I fix that by adding a single whitespace character at the end of the line though (which I don't really like). How to fix the cutting, if there's any way? The box on the right is smaller because the height of the text inside of it is smaller. EDIT : I saw that I could fix this problem by using myTextObject.padding.setTo(width, height). However, I'm using text objects everywhere. Is there a way to globalize this padding for every text with this font?
Hi there, I'm trying to make some kind of a worm bit on my map, the problem is that the map is not a tile map, it's a sprite and has p2 physics on it so that I can use it as a sensor. I've been trying to make a bitmapData onto which I copy a circle of the background and overlap it to the map, but it does not work. Any idea is much appreciated.