Welcome back! At this point, we've covered a full overview of shaders in GameMaker so now you are ready to write some shader effects! This tutorial covers the basics of color effects such as color inversion, grayscale, saturation and sepia tone. There is also GM Shaders example project which includes all the code covered here. I'll leave another link for you at the bottom of the page.
This was written in collaboration by my friend, Bart; I wrote the code/examples and he wrote the tutorial. You can expect to see more collaboration tutorials in the near future!
Okay, now time to dig in!
make_color_rgb(red, green, blue)
- Create a color from the given red, green and blue componentsmake_color_hsv(hue, saturation, value)
- Create a color from the given hue, saturation and value componentsmerge_color(color1, color2, amount)
- Mix colors color1
and color2
according to amount
. An amount of 0.5 is right in the middle.c_black
and c_white
, or define a color by assigning a hexadecimal value. For that you start with a $
and then type the hexadecimal value of the blue, green and red component respectively. You can also add the alpha value in front of those. Each of these can go from 00
to FF
, or, in decimal, from 0
to 255
. The order of the components is ABGR.
// A couple of common colors in hexadecimal
color = $000000; // c_black
color = $FFFFFF; // c_white
color = $0000FF; // c_red
color = $FF0000; // c_blue
color = $00FFFF; // c_yellow
To get the red, green and blue components of a color you can use color_get_red
, color_get_green
and color_get_blue
.
Colors can be passed to a shader through vertex attributes. The vertex color is stored in the vertex attribute in_Colour
by default.
If you don't draw your own vertex buffer using vertex_submit
or when you draw custom primitives - so you simply use GameMaker's built-in draw_sprite
and related draw functions - then this attribute contains the value of the instance's image_blend
variable.
If you draw a custom primitive then in_Colour
contains the value that you defined in a call to draw_vertex_color
or draw_vertex_texture_color
or, when you use the functions that don't specify a color, the value set by draw_set_color
.
If you submit your own vertex buffer to the GPU then in_Colour
contains the color that you assigned to that vertex using vertex_color
.
An important thing to keep in mind when using colors in custom vertex buffers is that a color is stored as four bytes in a buffer, with component values ranging from 0 to 255, but it is turned into a vec4 in the shader, which are four floats in the range 0 to 1.
As mentioned above, all of the above colors contain the red, green and blue components in a range of 0 to 255. Most of the time when you're using these colors with shaders you don't have to worry about the values being usable in the shader. If you add them as a vertex attribute, you simply pass the color as the argument to the function.
If you draw a primitive you also pass the color as the argument to the function.
In each of those cases the components' values range from 0 to 255. Once you're inside the shader they will be floats that range from 0 to 1 (colors are either a vec3
or a vec4
if the alpha component is included).
Any 3 or 4 floats that are sent to a shader via a uniform can also be interpreted as a color (+ alpha). But in this case you have to divide the components by 255 yourself, so in the end you'll send the following values for a color:
// Conversion of a color variable in GameMaker to an array of values
// that is ready to be sent as a uniform
var color = c_white;
var color_uniform_values = [
color_get_red(color)/255,
color_get_green(color)/255,
color_get_blue(color)/255,
// alpha // Alpha is already a value from 0 to 1
];
// Setting the uniform's value
shader_set_uniform_f_array(u_colors, color_uniform_values);
It is probably clear that you could do this conversion in the vertex shader or the fragment shader. But that would not be very efficient since the calculation will then be done for every vertex or fragment. It is also simply very convenient to have the values ready for use in the shader!
Okay, so far for the rather dull yet necessary part of how to guarantee to get your colors in a shader correctly.
It is now time to look at the inside of the shader!
gl_FragColor = v_color * texture2D( gm_BaseTexture, v_texcoord);
This is how GameMaker normally calculates the pixel color in the fragment shader when you're not using a custom shader or when you're setting the default "passthrough" shader that you get when adding your own shader. The function call to texture2D
looks up the actual pixel color on the texture that you're drawing.v_color
is multiplied by the respective component of texture2D
. The result of it is assigned to gl_FragColor
.image_blend
is set to white by default to get the original pixel's color. The r, g, and b components of v_color
all have to be 1 so the final color becomes the color of the pixel on the texture. Interestingly enough this also means that setting the blend color to something other than white will always make the resulting image darker.
One of the more basic things that you can do with colors is invert them. A color is inverted by inverting every component except the alpha component.
Inverting a component doesn't mean that you "negate" it. As mentioned before component values range from 0 to 1. So you cannot go below 0. What you do here is subtract the component value from 1, so you do one minus component:
//The formula for a single component
float new_component_value = 1.0 - component_value;
// How you could write this in GML (remember GM ranges from 0 to 255)
r_invert = 255 - color_get_red(color);
g_invert = 255 - color_get_green(color);
b_invert = 255 - color_get_blue(color);
invert = make_color_rgb(r_invert, g_invert, b_invert);
// The much shorter way of writing this in a shader
vec4 invert = vec4(1.0 - color.rgb, 1.0);
Food For Thought (1) Which color do you have to invert to end up with a yellow color? Which color do you have to invert to end up with a purple color? Which color doesn't change at all by inverting it? Why is that?
A second basic effect is grayscale. As you may remember from #4 Tips and Tricks, here you take a weighted sum of the red, green and blue components and use that result as the value for every component. The weights are adjusted to account for the perception of color that we humans have.
The formula to get the grayscale value is the following:
float gray = 0.299 * tex.r + 0.587 * tex.g + 0.114 * tex.b;
This can be simplified by using a dot product! (which GPUs are really good at computing). If you happen to end up with a formula of the above form then you can always write it in a much shorter way using the dot
function:
float gray = dot(tex, vec4(0.299, 0.587, 0.114, 0.0));
The factor for alpha is set to 0 to make sure that component doesn't influence the result. Zero times anything you can think of is still zero. Alternatively you can take the dot product of tex.rgb
and a vec3
.
To get the final pixel color you create a new vector with all components set to the value of gray
:
gl_FragColor = vec4(gray, gray, gray, 1.0);
Food For Thought (2) How can you use the dot
function to take the (non weighted) average of the rgb components?
The grayscale value can be used further to create a saturation effect. In this effect the original color is mixed or blended with the new grayscale color depending on the saturation value. As the description may have given away, you can do this in a shader using the mix
function.
The fragment shader code for a saturation shader looks like this:
vec4 tex = v_color * texture2D( gm_BaseTexture, v_texcoord);
float gray = dot(tex, vec4(0.299, 0.587, 0.114, 0));
vec4 shade = vec4(gray, gray, gray, tex.a);
gl_FragColor = mix(shade, tex, u_saturation);
The reason why this works the way it does becomes more clear if you look at the mathematical formula that mix
uses. Let's take a detailed look at this for a moment:
new_rgb = shade * (1 - u_saturation) + tex * u_saturation;
Set u_saturation
to 0 here and all that's left is shade
. Set it to 1 and what's left is tex
.u_saturation
between 0 and 1 the factor (1 - u_saturation)
is always greater than 0, so you get an influence of the grayscale value shade
.u_saturation
to a value greater than 1.
The factor (1 - u_saturation)
then becomes negative so you then subtract gray instead. At the same time you increase the influence of the other term: the original color tex
becomes more important when u_saturation
is greater than 1.
In a tone shader you do things differently, but only slightly. So far the final fragment color has been a linear mix of the grayscale value and the original pixel color. By applying a new color to the grayscale value, the tone, you end up with a tone shader. You then no longer blend the pixel color between a simple grayscale color and the original one, a tone shader gives you the possibility to blend between the original pixel color and a colorized grayscale image!
The tone is sent to the shader via a new color uniform u_tone
.
vec4 tex = v_color * texture2D( gm_BaseTexture, v_texcoord);
float gray = dot(tex, vec4(0.299, 0.587, 0.114, 0));
vec4 shade = vec4(gray * u_tone.rgb, tex.a);
gl_FragColor = mix(shade, tex, u_tone.a);
This tone might be familiar to you, it gives the typical look of an old photograph. Sepia is a color that is somewhere between red and brown. Wikipedia defines the color sepia as follows:
Sepia is a reddish-brown color, named after the rich brown pigment derived from the ink sac of the common cuttlefish Sepia.If you set the tone color to this color then you get a nice sepia effect! Let's do that for a moment and see what the result is:
This is one example of a color that you can use to colorize your image but of course any color is possible.
You may notice that the original pixel color is completely gone here. That is because the alpha component of u_tone
is set to 1. You can change that alpha value to start blending between the toned image and the original one to get more possible effects based on this shader.
Congratulations! In this tutorial you learned how to write a color inverter, grayscale shader, saturation shader and sepia tone shader!
You learned in which ways GameMaker supports colors, how you can define them and through which ways you can send the values of those colors to a shader.
The tutorial then covered the first basic effects that you can achieve with colors: inverted colors, grayscale and saturation and tone, with sepia as a specific example.
Hopefully this tutorial has given you the basic knowledge and insights to get your first color shaders working and start playing around with pixels' colors!
Next time, we're going to go deeper into color effects!
Blue is the color that you have to invert to get yellow, since vec3(1.0, 1.0, 1.0) - vec3(0.0, 0.0, 1.0) = (1.0, 1.0, 0.0)
.
A color of 50% gray doesn't change at all since vec3(1.0, 1.0, 1.0) - vec3(0.5, 0.5, 0.5) = (0.5, 0.5, 0.5)
.
The most important here is that you take a color's rgb or set the alpha to 0. Then take the dot product with a vector with all components set to 1/3: dot(color.rgb, vec3(1.0/3.0))
. This could be generalized by 1/number_of_components_to_be_averaged.


CiviGuard.com »
Email Confirmation
Your password as it has been encrypted in our database and we cannot retrieve it for you. However, you can request a new one which will be activated in the same way as this account. In order to do so we need your email to be confirmed.
Email:
{{ error }}
Copyright © 2010 CiviGuard, Inc. All rights reserved.


These Terms will be applied fully and affect to your use of this Website. By using this Website, you agreed to accept all terms and conditions written in here. You must not use this Website if you disagree with any of these Website Standard Terms and Conditions.
Minors or people below 18 years old are not allowed to use this Website.
Other than the content you own, under these Terms, Let's Go and/or its licensors own all the intellectual property rights and materials contained in this Website.
You are granted limited license only for purposes of viewing the material contained on this Website.
You are specifically restricted from all of the following:
Certain areas of this Website are restricted from being access by you and Let's Go may further restrict access by you to any areas of this Website, at any time, in absolute discretion. Any user ID and password you may have for this Website are confidential and you must maintain confidentiality as well.
In these Website Standard Terms and Conditions, "Your Content" shall mean any audio, video text, images or other material you choose to display on this Website.
Your Content must be your own and must not be invading any third-party’s rights. Let's Go reserves the right to remove any of Your Content from this Website at any time without notice.
This Website is provided "as is," with all faults, and Let's Go express no representations or warranties, of any kind related to this Website or the materials contained on this Website. Also, nothing contained on this Website shall be interpreted as advising you.
In no event shall Let's Go, nor any of its officers, directors and employees, shall be held liable for anything arising out of or in any way connected with your use of this Website whether such liability is under contract. Let's Go, including its officers, directors and employees shall not be held liable for any indirect, consequential or special liability arising out of or in any way related to your use of this Website.
You hereby indemnify to the fullest extent Let's Go from and against any and/or all liabilities, costs, demands, causes of action, damages and expenses arising in any way related to your breach of any of the provisions of these Terms.
If any provision of these Terms is found to be invalid under any applicable law, such provisions shall be deleted without affecting the remaining provisions herein.
Let's Go is permitted to revise these Terms at any time as it sees fit, and by using this Website you are expected to review these Terms on a regular basis.
The Let's Go is allowed to assign, transfer, and subcontract its rights and/or obligations under these Terms without any notification. However, you are not allowed to assign, transfer, or subcontract any of your rights and/or obligations under these Terms.
These Terms constitute the entire agreement between Let's Go and you in relation to your use of this Website, and supersede all prior agreements and understandings.
These Terms will be governed by and interpreted in accordance with the laws of the State of af, and you submit to the non-exclusive jurisdiction of the state and federal courts located in af for the resolution of any disputes.


Toggling a Multi Selection¶
The toggle
selection transformation inserts or removes data values from a multi selection if they, respectively, are or are not already members of it.
It can take one of the following values:
false
– disables toggling behaviour; as the user interacts, data values are only inserted into the multi selection and never removed.- A Vega expression which is re-evaluated as the user interacts. If the expression evaluates to
true
, the data value is toggled into or out of the multi selection. If the expression evaluates tofalse
, the multi selection is first clear, and the data value is then inserted.
Vega-Lite automatically adds a toggle transformation to all multi selections by default, with the following definition: "toggle": "event.shiftKey"
. As a result, data values are toggled when the user interacts with the shift-key pressed.
Examples¶
Highlight points in the scatterplot below by into the paintbrush
selection when clicking with:
.


Automation Success Rate
|
%
Last 24h
Last 24h
%
Last 7d
Last 7d
%
Last 14d
Last 14d
What is impacting my automation success rate?
How to increase success rate by %
| # | Recommendation | Impact |
|---|
Top 5 failing tests (maturity > 3 days)
| # | Test | Age | Failures | Passes |
|---|
Top 5 problematic devices
| # | Model | OS | ID | Passes | Failures | Errors |
|---|


{% extends "layout-side-nav.html" %} {% import "_vars-doing-business-with-us.html" as vars with context %} {%- set active_nav_id = 'future-requests' -%} {% block title -%} Doing Business with Us: Future Requests {%- endblock %} {% block desc -%} Information about expected procurement requests by the CFPB. {%- endblock %} {% block content_main_modifiers %} {{ super() }} content__flush-bottom {% endblock %} {% block content_main %}
These are significant procurement requests we expect to make in the near future. The Bureau’s strategic plan extends over five years, so we can make reasonable estimates about what we’re likely to need, though of course these requests aren’t certain to happen as listed.
Find current openings at FedBizOpps The needs below are forecasted, not current. Our fiscal year starts in October, so, for example, FY2015 Q1 is October–December 2014.
{% set page = get_document('pages', '63169') %} {{ page.content | safe }} {% include "_process-smbiz-footer.html" %} {% endblock %}


Impact
The adversary is trying to manipulate, interrupt, or destroy your systems and data.
Impact consists of techniques that adversaries use to disrupt availability or compromise integrity by manipulating business and operational processes. Techniques used for impact can include destroying or tampering with data. In some cases, business processes can look fine, but may have been altered to benefit the adversaries’ goals. These techniques might be used by adversaries to follow through on their end goal or to provide cover for a confidentiality breach.
Techniques
Techniques: 14
| ID | Name | Description |
|---|---|---|
| T1485 | Data Destruction |
Adversaries may destroy data and files on specific systems or in large numbers on a network to interrupt availability to systems, services, and network resources. Data destruction is likely to render stored data irrecoverable by forensic techniques through overwriting files or data on local and remote drives. Common operating system file deletion commands such as |
| T1486 | Data Encrypted for Impact |
Adversaries may encrypt data on target systems or on large numbers of systems in a network to interrupt availability to system and network resources. They can attempt to render stored data inaccessible by encrypting files or data on local and remote drives and withholding access to a decryption key. This may be done in order to extract monetary compensation from a victim in exchange for decryption or a decryption key (ransomware) or to render data permanently inaccessible in cases where the key is not saved or transmitted. In the case of ransomware, it is typical that common user files like Office documents, PDFs, images, videos, audio, text, and source code files will be encrypted. In some cases, adversaries may encrypt critical system files, disk partitions, and the MBR. |
| T1491 | Defacement |
Adversaries may modify visual content available internally or externally to an enterprise network. Reasons for Defacement include delivering messaging, intimidation, or claiming (possibly false) credit for an intrusion. |
| T1488 | Disk Content Wipe |
Adversaries may erase the contents of storage devices on specific systems as well as large numbers of systems in a network to interrupt availability to system and network resources. |
| T1487 | Disk Structure Wipe |
Adversaries may corrupt or wipe the disk data structures on hard drive necessary to boot systems; targeting specific critical systems as well as a large number of systems in a network to interrupt availability to system and network resources. |
| T1499 | Endpoint Denial of Service |
Adversaries may perform Endpoint Denial of Service (DoS) attacks to degrade or block the availability of services to users. Endpoint DoS can be performed by exhausting the system resources those services are hosted on or exploiting the system to cause a persistent crash condition. Example services include websites, email services, DNS, and web-based applications. Adversaries have been observed conducting DoS attacks for political purposes and to support other malicious activities, including distraction, hacktivism, and extortion. |
| T1495 | Firmware Corruption |
Adversaries may overwrite or corrupt the flash memory contents of system BIOS or other firmware in devices attached to a system in order to render them inoperable or unable to boot. Firmware is software that is loaded and executed from non-volatile memory on hardware devices in order to initialize and manage device functionality. These devices could include the motherboard, hard drive, or video cards. |
| T1490 | Inhibit System Recovery |
Adversaries may delete or remove built-in operating system data and turn off services designed to aid in the recovery of a corrupted system to prevent recovery. Operating systems may contain features that can help fix corrupted systems, such as a backup catalog, volume shadow copies, and automatic repair features. Adversaries may disable or delete system recovery features to augment the effects of Data Destruction and Data Encrypted for Impact. |
| T1498 | Network Denial of Service |
Adversaries may perform Network Denial of Service (DoS) attacks to degrade or block the availability of targeted resources to users. Network DoS can be performed by exhausting the network bandwidth services rely on. Example resources include specific websites, email services, DNS, and web-based applications. Adversaries have been observed conducting network DoS attacks for political purposes and to support other malicious activities, including distraction, hacktivism, and extortion. |
| T1496 | Resource Hijacking |
Adversaries may leverage the resources of co-opted systems in order to solve resource intensive problems which may impact system and/or hosted service availability. |
| T1494 | Runtime Data Manipulation |
Adversaries may modify systems in order to manipulate the data as it is accessed and displayed to an end user. By manipulating runtime data, adversaries may attempt to affect a business process, organizational understanding, and decision making. |
| T1489 | Service Stop |
Adversaries may stop or disable services on a system to render those services unavailable to legitimate users. Stopping critical services can inhibit or stop response to an incident or aid in the adversary's overall objectives to cause damage to the environment. |
| T1492 | Stored Data Manipulation |
Adversaries may insert, delete, or manipulate data at rest in order to manipulate external outcomes or hide activity. By manipulating stored data, adversaries may attempt to affect a business process, organizational understanding, and decision making. |
| T1493 | Transmitted Data Manipulation |
Adversaries may alter data en route to storage or other systems in order to manipulate external outcomes or hide activity. By manipulating transmitted data, adversaries may attempt to affect a business process, organizational understanding, and decision making. |


Joyous
At Shir Tikvah, joy can be big and loud, or intimate and quiet.
It’s ten teenagers making pizza before a youth group meeting.
It’s the deep, long breath taken when chanting a niggun—a repetitive melody without words before a prayer.
It’s a group of folks spending the day at a Habitat for Humanity worksite.
It’s two sets of grandparents, one Catholic, the other Jewish, when they hand the Torah to their grandchild at her bat mitzvah.
It’s the community welcoming a newborn at a Friday night service, and it’s the feeling that returns, with time, when remembering a loved one.
× Close


Copy and Paste the new URL to stream from your currently streaming laptop
How To Stream
1) Stream a movie with Popcorn Time on any computer (You can start the stream and immediately pause it if you want, it will not effect the stream).
2) Go to this mobile streaming website and input the local IP address of the computer currently streaming a movie via Popcorn Time. You must be on the same netwok as this computer. Want to stream from anywhere? See note below.
3) That's It! Kick back and enjoy. Don't for get the popcorn!
Note: You can stream from anywhere (so you're not tied to the same network) by using your public/external IP address and port forwarding port 8888 on your router. Works On All Mobile Devices. No Flash Player Required