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
24
votes
3answers
9k views

Best way to mask 2D sprites in XNA?

I currently am trying to mask some sprites. Rather than explaining it in words, I've made up some example pictures: The area to mask (in white) Now, the red sprite that needs to be cropped. The ...
21
votes
4answers
9k 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 ...
7
votes
0answers
180 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 ...
5
votes
2answers
992 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 ...
5
votes
1answer
15k 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,...
5
votes
1answer
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 ...
5
votes
1answer
408 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/...
3
votes
1answer
360 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 ...
3
votes
1answer
4k 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 ...
3
votes
2answers
7k 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 ...
3
votes
1answer
413 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 ...
3
votes
1answer
1k 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 <...
3
votes
1answer
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 ...
3
votes
1answer
334 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: ...
3
votes
2answers
714 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 ...
2
votes
1answer
1k 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 ...
2
votes
1answer
95 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 ...
1
vote
2answers
144 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 ...
1
vote
1answer
57 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 ...
1
vote
2answers
3k 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 ...
1
vote
1answer
508 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 ...
1
vote
1answer
156 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 ...
1
vote
2answers
579 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 ...
1
vote
1answer
121 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 ...
1
vote
1answer
154 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 ...
1
vote
0answers
318 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 ...
1
vote
0answers
121 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 ...
1
vote
1answer
2k 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 ...
1
vote
0answers
819 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 ...
1
vote
1answer
4k 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 ...
0
votes
1answer
951 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 ...
0
votes
2answers
103 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 ...
0
votes
1answer
33 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 ...
0
votes
1answer
280 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 ...
0
votes
1answer
237 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 ...
0
votes
1answer
163 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 ...
0
votes
0answers
32 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: ...
0
votes
0answers
44 views

How can you set a clipping mask for drawing operations in Godot?

I'm trying to draw a line that looks like this: I'm hoping to achieve this by drawing a line like this: and then somehow clipping it with a rect to look like the line above. I'd like to use the ...
0
votes
1answer
243 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 ...
0
votes
1answer
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 ...