Skip to main content

Questions tagged [masking]

Masking is a digital image processing term simialar in concept to bitmasking. An image mask is applyed pixel-by-pixel to other image and behaves like a sieve to color values.

Filter by
Sorted by
Tagged with
1 vote
3 answers
88 views

Unity/URP global volume with volume mask still applies effects to all layers

I simply would like to apply the Global Volume only on specific layers but I probably misunderstood how it works. Environment & Inspectors GameObject\ ...
Baro's user avatar
  • 81
5 votes
2 answers
329 views

How would I mask the player node out of a canvas shader?

I'm making a 3D game, and I want to create a post processing effect using a canvasitem and a colorrect, that effects everything on screen apart from the player. I already have the shader itself made, ...
JackHainsworth's user avatar
0 votes
1 answer
1k views

How can I create a mask for 2d lights in Unity?

I'm working on a top-down 2d game in Unity. assume my world/map looks like this through the player's eyes: (The art isn't mine, this is just an example) Now by making art directly like this, I can ...
python newbie's user avatar
15 votes
4 answers
5k views

What is a 'Mask' in Game development?

What does it mean a 'mask' in 2D (and possibly 3D) Game development? What would an experience Game Dev understands if I say ´make this Rect a mask´? I know it could be a very broad term and it may ...
Federico Baù's user avatar
0 votes
1 answer
363 views

Clip a 2D sprite within a bounding box without masking

In Unity, working on a 2D game, I have a platform game where the platforms can "sink" when jumped on. The platforms are 32x32 sprites, and when sinking, the desired effect is to push the ...
Gadi A's user avatar
  • 103
1 vote
0 answers
168 views

How do I make a mask that dictates which layers are visible in Unity?

I'm trying to create an effect where the player progresses from one level to the next by a portal appearing as a rip in the fabric of time, and the portal grows until it'd half the screen, then ...
JShoe's user avatar
  • 75
0 votes
0 answers
271 views

OpenGL I want my image to change color based on stencil

I have an image and a rectangle on the screen, using the using this stencil functions I managed to render or not render a certain part of my image. ...
shrain's user avatar
  • 1
0 votes
1 answer
691 views

Pygame logic to make a player stop at obstacles without overlapping them

what's the best logic to force the player to change its direction when he's just next to an obstacle (building, rock, tree..) ? I know this is related to collision detection but maybe my logic isn't ...
Salem's user avatar
  • 226
0 votes
0 answers
100 views

How to create opacity mask from colored bitmap?

For the image (bitmap) below, if I do: Create a spite with the image in unreal engine. Create a opacity mask on the spite. Use this image, choose a specific color, such as blue, make its ...
Zizheng Yang's user avatar
0 votes
0 answers
343 views

How to programmatically overlay a shader on a terrain by mask (Unity)?

I can paint the terrain with textures.I would like to see water drawn with a shader, and not a stationary water texture on the terrain. Moreover, it was possible to assign a shader to the terrain, but ...
Ivan Triumphov's user avatar
1 vote
0 answers
195 views

Adding underwater shadow to 2D top down boat

I have a boat/hovercraft sprite in my game. It's topdown 2D view, but it's actually a 3D scene, for better lighting and other effects. I want to add a buoyancy effect, so that the hovercraft floats ...
Colinch's user avatar
  • 111
2 votes
1 answer
129 views

How to replace texture maps on models in a packaged game?

I'm trying to do an experiment. I'd like to do some object masking to the assets inside of a game, so during run time, when you are playing, they're texture maps are replaced by the masks. The masks ...
lazylama's user avatar
4 votes
1 answer
9k views

How to use a sprite mask or shader to mask a text?

I'd like to know what I need to learn to apply a shader to achieve masking on the text. Here is my text object in-game, I'm using a sprite mask to mask the game objects on the card, they're all in ...
CollisionOfConcepts's user avatar
0 votes
0 answers
156 views

Pygame Mask Doesen't Detect Collisions

I'm trying to make my game's collisions with masks. I have 6 masks but only 2 works. My code is: ...
GospelBG's user avatar
0 votes
1 answer
39 views

Use 2 values of a mask

Let's say one has a black/gray/white mask and wants to draw picture A over the white/gray values and picture B over the black/gray values (the blacker the more B picture). The best I come up with ...
Meowxiik's user avatar
2 votes
0 answers
269 views

How can I make a transparent hole with shaperenderer using stencil masking in libgdx?

I'm making a 2d game, where I need a resizeable, moveable rectangle outline. I'm trying to use stencil masking to do it by cutting a hole in a solid rectangle, and I thought this would help: How can ...
Shaw's user avatar
  • 21
3 votes
1 answer
523 views

How do I make mask work

I have been trying to make a game, but mask collision doesn't seem to work. Here is my code: ...
KMuJu's user avatar
  • 31
0 votes
1 answer
3k views

Substance Painter: Face selection Mask

Is there a possiblilty to select the polygons of the model that the brush will apply to? This is what happens when I paint the insides of a house. Inside: Outside: As if the absence of WASD Camera ...
AzulShiva's user avatar
  • 669
0 votes
1 answer
488 views

Sprite masking with multiple, non-equally dimensioned textures in XNA

I know this question's been asked many times before, but I can't seem to get sprite masking to work in XNA/Monogame no matter if I try the stencil method, or the shader method. Considering I'm having ...
tayoung's user avatar
  • 111
1 vote
1 answer
440 views

Managing draw calls for customized materials when targeting mobile

I want to know how to minimize draw calls when rendering multiple customized characters onscreen, presumably with 3-4 materials apiece. Is there a better way to achieve custom color configurations ...
reversetrio's user avatar
0 votes
1 answer
378 views

ScreenToWorldPoint problems in otherwise awesome Unity demo

I am using this neat Unity demo I found on Stack Overflow, which demonstrates texture masking via RenderTexture: Can you erase a texture in real time in Unity But the mapping from mouse position to ...
Cherdyakov's user avatar
1 vote
0 answers
338 views

Stencil inside Stencil? (Multiple masks on same object)

So please take a look at what I want to achieve The Red and Blue part is the object I want to mask. The thing is that it will be masked by the green area, and only after that it will be masked by the ...
user3412355's user avatar
1 vote
0 answers
177 views

Stencil IncrSat and DecrSat explanation

Can someone please explain me what is the purpose of IncrSat and DecrSat? Currently I know that they increment/decrement the current value in the buffer and they make sure the value is between 0 and ...
user3412355's user avatar
0 votes
2 answers
156 views

Cannot get mask with multiple textures to work

I am trying to render three textures: Background, Black/White Foreground Mask and Foreground. I have used this OpenGL - mask with multiple textures, but I cannot get it to work. I only get the last ...
Javier Ramírez's user avatar
0 votes
1 answer
336 views

How do i make an object to be visible only on a particular layer?

Please refer the image below to understand. I am working on 2D game. I have three elements: "background(layer 0), foreground(layer 1) and the object". I have used sprite renderer to set background ...
user5185619's user avatar
5 votes
2 answers
1k views

How can I mask this CanvasRenderer?

I'm creating a text box that allows for selectable text, based off of Unity's InputField. An issue I am now facing is that the selection highlight does not respond to masks (The parent has a mask, but ...
Douglas Gaskell's user avatar
1 vote
2 answers
5k views

In Unity3D, how do I create an efficient scratch card effect?

I want to create a scratch-card-like effect in new Unity UI's new Image tag. I know it's possible with setPixels, but that's prohibitively expensive on mobile ...
idurvesh's user avatar
  • 530
5 votes
1 answer
507 views

How to clip or mask entity in android/andengine?

I want to implement masking with sprite in Andengine. I want same functionality as in ios class called SKCropNode which works like an masking node! Is there any workaround like this in andengine/...
Harin's user avatar
  • 191
1 vote
2 answers
176 views

Curved Meters and Gauges

I'm wondering how people here on GameDev stack exchange would handle curved meter GUI elements for things such as life bars or energy bars. My thought on the matter was that you could use a shader ...
TheYokai's user avatar
  • 160
4 votes
1 answer
4k views

OpenGL Positional 2D Texture Masking

I have a simple 2D java game engine running using LWJGL. I have my own vertex and fragment shaders, and I'm able to render quads with textures. I want to be able to mask one quad using the texture ...
Mark D.'s user avatar
  • 43
1 vote
2 answers
817 views

How can I chain together Stencil tests from the same re-occurring routine, but keep the tests separate?

Sorry for the bad title; I don't know how else to explain this. I have a class called a Container. An instance of Container has ...
NeomerArcana's user avatar
3 votes
1 answer
5k views

Can I break the UI MASK hierarchy in unity 4.6?

I'm using unity 4.6. I saw a couple of UI masks tutorials and saw that there's a certain hierarchy I can't seem to break: -Canvas --- Panel (holds the mask component) --------Image I want to move ...
Moria's user avatar
  • 101
3 votes
1 answer
2k views

How do I procedurally create a directional light cone with an HTML canvas?

To create a directional light effect, I want to draw this kind of transparency mask on an HTML canvas (using context2d): I also want to be able to generate such a mask dynamically. I've tried using <...
jesper's user avatar
  • 131
0 votes
1 answer
1k views

Cocos2d-x how to draw in specific free form area

Here https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.h and https://github.com/mikeccy/cocos2dx-finger-paint/blob/master/Classes/HelloWorldScene.cpp you can see how ...
Narek's user avatar
  • 1,337
1 vote
0 answers
962 views

Unity Free Inverse Depth Mask?

How would it be possible to create an inverse depth mask? In this case, I refer to a depth mask as a shader attached to a mesh that 'pokes a hole' through the current camera layer to let you see the ...
ilar's user avatar
  • 11
3 votes
1 answer
480 views

Desaturate texture using mask in OpenGL 2

I have a very large texture i am using as background and i want to apply a filter to a small part of it, the "small part" is defined by the alpha layer of another texture i have (which is still ...
FrankMonza's user avatar
1 vote
1 answer
133 views

Warp GameObject Size When Entering/Leaving Area

Below I have an image describing the desired functionality I am going for. Let's say you control a square and when you move this square into a given area, any part of your rigidbody/model inside of ...
Julian's user avatar
  • 109
3 votes
2 answers
8k views

How do I mask graphics in Unity to create a searchlight effect?

I'm trying to make a searchlight-style punchout mask effect in Unity 2D. This is the effect I'm looking for: That animation is made in Fireworks, using a white to black gradient circle masked on top ...
Mr Dreigon's user avatar
3 votes
2 answers
875 views

How are red dot/reflex/holographic sights implemented?

In first-person-shooters like Call of Duty, the hologram only appears when it is behind the glass portion of the sight. In OpenGL, would it be implemented by rendering the glass to the stencil buffer ...
Victor's user avatar
  • 131
5 votes
1 answer
16k views

Unity 4.3 (2D) Rendering only the parts of a sprite that are within specific bounds

I'm working in Unity, using the 2D features to recreate the match-3 style of 10000000 (Ten Million). I have a parent object (green square) with several children objects (blue rectangles) on top of it,...
NobodyNothing's user avatar
1 vote
1 answer
5k views

How to crop or mask a sprite to a specific shape in Unity (2D)?

I'm trying to do a procedural 2D terrain generation. I've managed to make the function to generate the points, and I've been testing/debugging by creating the terrain using a 2D polygon collider on an ...
Pat's user avatar
  • 189
3 votes
1 answer
2k views

theoretical solution for "drawing" with mask

So am trying to create a make-up game and i need to have a basic drawing solution, and so far i have made a good progress with the help of the DepthMask solution My approach was like this : suppose ...
alaslipknot's user avatar
1 vote
1 answer
186 views

Masking away part of image with mesh

I need to remove a section of an image using a 2D mesh. Since the image is destructible (artillery game style), it would be helpful to shrink the image in memory afterward. The portion in the blue ...
jzx's user avatar
  • 3,805
4 votes
1 answer
2k views

Faking 2d light using shader (Unity, Shaderlab)

Since the concept was difficult to explain in words for someone who's not quite familiar with shader, I described it in pictures. I'm currently using Unity and it seems Shaderlab is the best choice ...
lustdante's user avatar
  • 143
2 votes
1 answer
2k views

Masking OpenGL texture by a pattern

Tiled terrain. User wants to build a structure. He presses build and for each tile there is an "allow" or "disallow" tile sprite added to the scene. FPS drops right away, since there are 600+ tiles ...
user1304844's user avatar
1 vote
1 answer
657 views

How to only render part of an image in lwjgl/openGL

I'm making a mining/building game in java using slick2D and I want to make it so you can only see a few blocks in any direction while you are underground. The best example I could find of what I want ...
Ephyxia's user avatar
  • 11
21 votes
4 answers
13k views

A Simple Method To Create Island Map Mask

I'm searching for a nice and easy way to generate a mask for an island map with C#. Basically I'm using with a random heightmap generated with perlin noise, where the terrain is NOT surrounded by ...
Ace's user avatar
  • 533
7 votes
1 answer
203 views

How to use a mask texture with Kobold2D

I am an iOS developer but I'm new to cocos2d. I'm working on new game, I use Kobold2D, have cocos2d installed too, and I want to make this effect: I know how is done with Flash, but can't make it ...
alex's user avatar
  • 71
0 votes
1 answer
995 views

How do I check on non-transparent pixels in a bitmapdata?

I'm still working on my window cleaning game from one of my previous questions I marked a contribution as my answer, but after all this time I can't get it to work and I have to many questions about ...
Opoe's user avatar
  • 149
3 votes
1 answer
420 views

cocos2d mask rotation

I've been experimenting with Ray Wenderlich's tutorial about masking sprite using shaders with cocos2D 2.0. It works pretty well but now I'd like to rotate the mask independently of the masked ...
sdabet's user avatar
  • 227