Unity create material from image script The Image control displays a non-interactive image to the user. This project integrates TripoSR, a "a state-of-the-art open-source model for fast feedforward 3D reconstruction from a single image" by StabilityAI and TripoAI, and triposr-texture-gen directly into Unity Editor. materialForRendering property to try change the parameters at runtime. Sin( Time. For Texture Materials, follow the instructions in Creating a Texture Material. I have a script attached to it (gameobject) to change the image on run time. I am attempting to set a material to a game object in my game, I created the object in script so I dont have the option to set it manually through unity. And you need a reference to the Apr 1, 2015 · I’m trying to create a gradient as background from a script. In this tutorial, we will apply a new Material preset to a Font Asset. Additional resources: Materials, Shaders. You can use this thread to ask for help, share feedback, and have discussions about this new feature available in Unity 2022. So my question is - how do you save a material? Is it as simple as a binary serialization of the Jun 11, 2017 · If you have an image ui, it takes a sprite. Until now, I do this with: renderer. Find("Specular")); If you have a script which implements a custom special effect, you implement all the graphic setup using shaders & materials. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see: You've told us there are code samples on this page which don't work. Aug 26, 2011 · Hey guys, I want to make some objects in my scene blink. This will create new materials based on these textures. Here are examples of the color properties in Unity pre-built shaders: _Color: the main color of a material (URP: _BaseColor). When setting color values on materials using the Standard Shader, you should be aware that you may need to use EnableKeyword to enable features of the shader that were not previously in use. Note : Keep in mind that using a RawImage creates an extra draw call with each RawImage present, so it's best to use it only for backgrounds or temporary visible graphics. Raw Image The Raw Image control displays a non-interactive image to the user. 1. Thanks for any hint. Line Renderer Scene Editing Mode You can use the Line Renderer’s Inspector to change the Scene A Scene contains the environments and menus of your game. You might have done this already. The Unity Manual helps you learn and use the Unity engine. Sep 16, 2012 · It might be better to create an actual editor script, rather than using [ExecuteInEditMode], and save the resulting materials to the project. This allows you to modify numeric Jun 2, 2012 · I have a large number of assets, all with multiple materials that I generate on the fly. Aug 19, 2021 · You can make it move in any way you like by adding a script or you can make it invisible by changing the renderer properties. This function copies property values (both serialized and set at runtime), as well as shader keywords, render queue and global illumination flags from the other material. That’s why your color is white in the game. material will create a copy of the material for that specific renderer if the material is already shared. Dec 12, 2017 · I try to create material from this shape: for Deformed like the image above. Alpha component (a) defines transparency - alpha of one is completely opaque, alpha of zero is completely transparent. In order to get the material used by an object, use the Renderer. Oct 1, 2019 · Hi cloudstrife869520023, If I understand correctly you want to automate the creation of materials from large batches of images in the editor? If so you can do this with the following editor script. active = _renderTexture; Texture2D tex = new Texture2D(_renderTexture. All of this has to be in script etc. For more detail, read Accessing Materials via Script. white, renderer. Components (r, g, b) define a color in RGB color space. (For example, a red rectangle that has a material based on a shader that returns red for every pixel. The cheapest way is to hack the camera’s clipping frustum, just like in The Raw Image control displays a non-interactive image to the user. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. But I do not know how to make such materials in Unity For more information on color spaces, refer to Color spaces in Unity. When you add a Cube or Sphere model in Unity, the color of the model is white. github. EnableKeyword("_EMISSION"); And this works - in the scene, I can see that the Emission is enabled. Dec 22, 2022 · I want to create a 2D object with a visual component. Lerp( Color. More info See in Glossary window of the material: Set Rendering Mode to Transparent I have a UI image attached to a canvas. May 23, 2022 · Image myImage = GetComponent<Image>(); This all works great, but I want to set the a material to the image as it’s created. What unity hides from us and what makes this very bad is that by using the . If you know how to fix it, or have something better we could use instead, please let us know: You've told us there is information missing from this page Jul 4, 2010 · Hi, I know how to create a temp material for a game object, but is it possible to create a new asset within a script? I want to be able to do this as part of an editor script I'm writing. Each color component is a floating point value with a range from 0 to 1. SetColor("_Color1", SecondaryColor); } } Just set the original Material from the inspector and each instance will have its properties set by the script , in my example the material was attached to 4 diffent Images with the same material but different properties BAM done ! Dec 9, 2021 · Which script i need to change? You can’t “make” a RawImage into a 3D object. From Unity - Scripting API: Renderer. However, the Image control requires Jun 16, 2023 · In Unity, I want to generate a texture and apply it to a material. More info See in Glossary to the material asset, in the Inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit In Unity gradient effect is used for animating colors to achieve color blending. Material There’s a constructor where you pass in the shader that should be used by the material. However, one big issue I see is that you’re changing mesh UVs and you’re creating new materials with different tiling values. Jan 9, 2019 · Import the image into Unity by dragging the file from it’s folder into the Unity project panel. GetComponent<> () method in your Start() method. EnableKeyword (“_NORMALMAP”). What code do I need to use to add a material to this image component used in the UI? Cheers! To create a new material asset in your project, from the main menu or the Project View context menu, select Assets > Create > Material. We are super excited to introduce this new system (which has been requested for a long time and quite highly voted on our public roadmap!) to manage variants of materials at scale! It allows for reuse and improve Jun 8, 2023 · The Unity Editor uses Physically Based Rendering (PBR) in order to more accurately simulate realistic lighting scenarios. You can also use it to set custom shader properties that can't be accessed through the inspector (e. Dec 16, 2022 · When you access a renderer's material with the . Jun 6, 2016 · Can you use the existing Material on the Renderer? If the Material is being shared among many Renderers, accessing GetComponent (). I dont want to creat material in editor and assign "Custom/BLUR" shader to it, instead i want Unity to do it at runtime, since there could be any number of objects using this shader and i want them all to have its own dedicated material so i can manipulate them separately. Here is one: Create a class (say, ImageClass) that exposes properties for your RawImage and Textures. After create, i create a material with resources. In this tutorial, as you begin creating with materials, you’ll learn how to manage them in your projects To create a new material asset in your project, from the main menu or the Project View context menu, select Assets > Create > Material. If the Renderer is the only one using that material then it will reuse the same material. In my script, I do the following to enable Emission on a material (specifically, the Universal Render Pipeline/Lit material): myMaterial. In this quick guide, we will cover the basic steps of adding an image in Unity 3D. Is there a way to abandon the sine? I think, that would help already. You can use arrays for the textures, create your own custom editor property, etc. Material material = new Material (meshRende… Jun 27, 2019 · In this article, we will learn how to create and use materials, which can be used to add colors, patterns, and surface textures to objects. The solution is simple: Use Color32 instead, which takes a value from 0 to 255. More info See in Glossary for the new Material, Unity’s built-in Standard Particle Shaders work well with Line Renderers. In this article, we will explore the basics of Unity ‘s material system, including how to create and apply materials, how to edit material properties, and how to add textures to materials. Although shaders are a crucial part of the rendering process, you’ll use materials to do much of your creating. URP provides a template for custom post-processing You’ll apply these concepts to create your own materials and shaders that simulate real-world objects — and even some other-worldly objects. This structure is used throughout Unity to pass colors around. PBR Materials Effortlessly craft and export PBR materials compatible with the Godot, Unity and Unreal game engines, streamlining the game development process. Feb 17, 2025 · Hi, I wanted to make a quick script to expose material properties of an UI Image and animate them with an animator. You can use this for purposes such as decorations or icons, and you can change the image from a script to reflect changes in other controls. the unity documentation tells us to use SetKeys(), but when i try that code, gradient does not have SetKeys also, they don’t even have that page in C#… anywhere with a better explanation? also, my goal is, as i said, is to have a gradient as background for a 2D game, that changes from looking like morning to a dark night. These Materials are powered behind the scenes by a Shader and determine the look of your text in ways that ordinary font weights can’t. May 10, 2020 · Unity create Material on the fly - https://gist. In this article we will see how to configure Unity's Standard Shader to make objects transparent. Click the Shader dropdown under New Material in the Inspector window. I tried different approaches, trying to instantiate a material and replacing the original or using the Image. Click the material in project panel so the material properties are shown in the inspector. First, make a 3D object so you can map Texture2Ds onto Materials and put it on the MeshRenderer. 1 Much like other GameObjects, text created with TextMesh Pro can have multiple Materials applied to it. I have an OnClick function that changes the material of the Canvas Renderer for the image when it's clicked. In this tutorial, we will see how to make a Gameobject invisible using Unity editor or using code. After that you can change the sprite of your UI Image like the following. Apr 4, 2015 · The editor will set the keywords automatically for you. 0. Basically you need to render the mirrored camera to the texture, but clip whatever’s in front (or behind, from the reflection’s point of view) of the mirror. GetComponent<CanvasRenderer>(). 1 Unity Engine Graphics Jun 10, 2022 · Welcome to the Material Variants discussion thread. I will show you how to download and import seamless images into Unity and make materials. 0 to 1. How to take a 2D image available in a folder and dynamically create a texture/material from it through scripting not the unity editor. Apr 27, 2022 · Looks like another Unity bug, but want to verify it before I report. I should look like the Feb 3, 2023 · With Unity materials and textures, you can easily adjust the appearance of an object by changing its material, without having to modify its geometry. material; and a few other things (not a very good coder) and could use a hand. com The Raw Image can display any Texture whereas an Image component can only show a Sprite Texture. I am trying to have my code work like this, Button pressed → load new source image in image → repeats till last image. I was making a game with Unity and I want to change an object's material using UnityScript when the player collects 5 collectables that I made. By default, new materials are assigned the Standard Shader, with all map properties empty, like this: Once the Material has been created, you can apply it to an object and tweak all of its Sep 13, 2016 · Have you read the docs? Unity - Scripting API: Material. Jul 25, 2018 · I wrote a very simple script to create the basic material from the selected texture. To add colors and images to these models, we can use materials. Sep 30, 2019 · If I understand correctly you want to automate the creation of materials from large batches of images in the editor? If so you can do this with the following editor script. com/iwanPlays/04d399de55a98475d906103779ba9ff3Incomplete:Material mat = new Material(Shader. In recent versions of Unity, you will need to drop it on the square to the left of "Albedo". Except that the UI seems to be read-only. jpg464×552 31. png or . material Modifying material will Jun 2, 2012 · I have a large number of assets, all with multiple materials that I generate on the fly. 0, so it ignores anything higher than that and treats it as 1. Description Copy properties from other material into this material. When you create a new Material at runtime, the keywords will all be disabled by default. I'm posting a small script I made that allow you to create Materials from a Image. Find("Stan Sep 28, 2016 · Please help me, i follow the first tutorial and i write this script using UnityEngine; using System. In this tutorial, you will learn how to add transparent and translucent effects to your Unity developed a new set of Standard Shaders that are located in a new category. I think the material should default to Unity’s Standard shader. Oct 8, 2016 · The example below will create a Material, assign standard shader to it then change the texture to the texture from the myTexture variable before applying it to a GameObject. No See Create, modify, and apply Material Variants for detailed information about how to identify and revert Overrides. In this tutorial, as you begin creating with materials, you’ll learn how to manage them in your projects Nov 2, 2015 · If you want to change the texture used in your material (assuming you use the Unity Standard Shader) you'll have to get a texture by reference or from your resources, if you want to get it by name: Mar 17, 2010 · I'm trying to assign a material in the Project to a gameobject I create by code. For more information on defining properties, refer to Properties in Shader Programs. I’d rather have it just come from a material. Dec 9, 2017 · Hi my friends, I’m trying to create a material during runtime like this: In my Assets I have a Render Texture and one Material I created an Script where I attach the Render Texture to Material I save in my project a PNG Image File for later use public void CreateAndSaveMaterial() { RenderTexture. unity3d. I have a gameobject in UI (canvas) containing Image component and it has null image initially. There are different types of gradient uses in Unity 3D, based on the requirement the gradient in unity 3D can be achieved. Right-click inside of your Project and go to Create > Material. In this article, we’ll discuss how to use the gradient in UI such as Image Jan 9, 2018 · That’s modifying the image data as (presumably) the PNG doesn’t have any alpha it’s copying the greyscale value of the color into the alpha of the texture. Oct 27, 2023 · Material Variants Unity Engine 2018-3-beta 11 5215 September 21, 2018 [SOLVED]Editor Tool to create new materials Unity Engine Scripting 2 6224 September 21, 2009 Is there a way to modify/create materials using editor scrip Unity Engine Scripting 4 1770 July 28, 2010 Material Variants now available in Unity 2022. GetComponent<Image> (). Jul 21, 2017 · B) I use instantiate for create a gameobject from a prefab (Resources. That’s why I created Easy Material Assigner—a one-click solution that works across all render pipelines (URP, HDRP, Built-in) and supports 100+ texture types! Why This Tool Will Save You Hours 1 Tool for ALL Pipelines – Works seamlessly with URP, HDRP, and Built-in. Color gradients, or color transitions, can be defined as a gradual blending of colors from one to another. material getter, Unity instantiates a new copy of the material unique to this object — that's why you see an " (Instance)" added to its name. Nov 11, 2015 · I am currently having problems trying to change the source image of an UI image on a canvas. More info See in Glossary to the material asset, in the Inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit Feb 11, 2020 · With this setup we can change the properties via a script on a per object basis. We’ll cover how to change the colour of all objects with the same material and how to change individual instances. gameObject. Also, we will touch This structure is used throughout Unity to pass colors around. In Unity 3D, images can be added to a scene for various purposes such as UI elements, textures, and materials. When i now change the color from this materal what i have loaded, its then again a copy or it is the same? With best regards, Creepi Jun 27, 2019 · I guess the easiest example would be to have a 2D square and a 3D cube. Materials are assets (stored with your project and managed in the Project folder) that contain the colors, images, and other properties that define the appearance of a mesh. Material's shader is not changed. material field of the renderer like this, we create a new Material every time we want to modify it. Next you want to assign your image to this material and you can go about doing this by dragging and dropping your image (which is in the project window) on to your newly created material. May 17, 2024 · public Image uiImage; You can drag and drop your Image into the script component from your Unity editor or you can use the GameObject. Note: Currently, you can’t create Materials that update and initialize Custom Render Textures in Shader Graph. In this tutorial, you will learn about standard Shaders and Dec 10, 2012 · 199179-wwwww. If you wanted the normal map, you could activate that shader variant using Material. 0 to a variable of type Color, which takes values from 0. This is done through the Shader — the script that mathematically calculates how a material should appear under different lighting conditions. URP provides a template for custom post-processing This tutorial has been verified using Unity 2019. The material will be of an image that I want to create that will hopefully fit the mesh perfectly. Among the many wonderful things a shader can do is to render whatever is on the other side of a mesh along with, or even instead of, the mesh itself. You can create the materials, then assign them using sharedMaterial. texture as Material; button. You’ll apply these concepts to create your own materials and shaders that simulate real-world objects — and even some other-worldly objects. material property. Oct 18, 2022 · Unity Developer Jordi Caballol shares advanced Editor scripting hacks that are sure to save you time on your next project in the latest Tech from the Trenches column. Create, which takes a texture as one of the parameters and then lets you declare size for the sprite and then you assign the sprite you created to the sprite part instead of trying to assign a texture to the texture part. color = Color. color is a example from the docs also if the color you are trying to change is not the materials main color you will have to use. Unity even gives us a little warning to nevr do this in editor code. This allows you to modify numeric The Raw Image control displays a non-interactive image to the user. g. The Raw Image can display any Texture whereas an Image component can only show a Sprite Texture. With the Unity engine you can create 2D and 3D games, apps and experiences. e. material = myMaterial; Thank You Jan 19, 2021 · I have a 3d mesh in my Unity Scene that I want to create a material for. which Oct 23, 2014 · Just take the unity example reflective water asset and trim out what you don’t need. docs. The cheapest way is to hack the camera’s clipping frustum, just like in For more information on color spaces, refer to Color spaces in Unity. To create a new Material, use Assets->Create->Material from the main menu or the Project View context menu. However, my object with the material shows only a gray "defa If you want to create your own standard Unity Material, follow the instructions in Creating and Using Materials in the Unity manual. although it doesn’t attach to a material, you can just attach it to a game object, and it will tile using the tile x, and y in the editor (you will have to change the texture from a script) Jul 11, 2014 · You could create an editor script to do this using AssetDatabase. load and attached it on the other gameobject. Feb 6, 2015 · Several ways to set this up. width, _renderTexture Jun 11, 2017 · If you have an image ui, it takes a sprite. You can only create shaders that operate on Custom Render Textures by writing ShaderLab Unity’s language for defining the structure of Shader objects. 4 LTS and TextMeshPro v2. material Modifying material will Nov 15, 2025 · Scripting with Assets Here are some of the things you can do with Assets via scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. You can access this shader property via the color property. Start with simplifying the shader, remove all the wave distortions etc. Jun 26, 2025 · Using AssetDatabase, we can create a Unity Editor script that exposes a menu item for us to process and assign the texture to the surface map of the default Lit shader, creating a new Material and saving it for each Mahjong Tile texture. Creating a Texture Material Before you create the Material, make sure you have a 2-dimensional image file (BMP, JPG, PNG, TIF etc. You’d have to do this manually when doing this from script, or alternatively actually save your PNG with the alpha you want to begin with. If you attempt to delete the parent of a Material Variant, Unity warns you to select a new parent for the child or reparent it. By default, new materials are assigned the Standard Shader, with all map properties empty, like this: Once the Material has been created, you can apply it to an object and tweak all of its properties in the Inspector A Unity window that displays information about the currently selected You've told us this page needs code samples. I have a UI image attached to a canvas. Unity prevents inheritance issues Unity protects against ancestor deletion and circular dependencies. All the parameters of a material asset that you see in the Inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. Shader Graph. To fully take advantage of PBR, a material should be physically based. I’m doing all of this in the editor - in the end game, I’d just like to swap materials around, not generate and manually load textures. More info See in Glossary, follow these steps in the Inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. You can assign a Texture to a Material and assign that to a MeshRenderer of a 3D object. It also enables more seamless collaboration between programmers, artists, and designers for faster prototyping and iteration. Nov 3, 2020 · In this Unity game development tutorial we're going to look at how we can write a script to change the Albedo colour of a material. Once you have that up, you need a reference to the MeshRenderer to change out its Material. Use this function to create a custom shader & material inside your script. Quick and dirty just to show how to change the texture…your code would need to handle the swap, presumably based on game logic: The texture property of the RawImage gets/sets the The Raw Image control displays a non-interactive image to the user. To use this right click your image and select Create… Jun 6, 2011 · I basically making like a huge fallen log that you can walk around in out of planes but on the inside I want it to have a wood grain texture so I took a picture of some cut wood that was just in my garage and i just want to know the steps of making that picture into a material. More info See in Glossary when viewing a material are accessible via script, giving you the power to change or animate how a material works at runtime. You've told us this page needs code samples. I’ve tried material = GetComponent (). color, Mathf. Collections; public class ExampleBehaviourScript : MonoBehaviour { void Update () { if (Input. However, I don’t want it to have an underlying sprite. You can get the right keywords from looking at the source for the Unity built-in To make a material transparent if it uses the Standard Shader A program that runs on the GPU. Create a new material by clicking on the assets menu and choosing create/ material. Feb 26, 2017 · use GetComponent to get the objects Renderer, than access its material attribute, from there you can lerp a new value into its color. Unity - Scripting API: Material. This class exposes all properties from a material, allowing you to animate them. Add this script to your Editor script folder and then right click on any number of textures and select ‘Create Materials’. Material mat = new Material(Shader. My question is how can I do that directly instead of creating a new Material, asign a shader, textures, etc. CreateAsset as shown in docs. Jul 23, 2017 · Hi How could I convert a Texture2D to a Material? Material myMaterial = www. Feb 12, 2017 · 0 i'm trying to create a unity script that will generate a 360° visit and it must be managed by a web platform (where you upload your 360° images ) so my sphere in the unity script must load external images for the sphere texture. The collectables get stored in an int variable called In this tutorial, we will be experimenting with the Standard Shader to create a variety of materials. The default Shader for a new Material in a project is Universal Render Pipeline/Lit. //Create a new RawImage by going to Create>UI>Raw Image in the hierarchy. It works like this: choose a texture (or several textures), from the menu “ Asset / Create Material ” and that’s all. By default, new materials are assigned the Standard Shader, with all map properties empty, like this: Once the Material has been created, you can apply it to an object and tweak all of its Nov 9, 2016 · I did create another image box with a script that scrolls though a number of images (sprites) when you press a specific key, however, that doesn’t link up at all with the game action script or whether that would even work for my purposes. which Unity Manual Learn how to use Unity to create 2D and 3D games, apps, and experiences. ) To my knowledge, a material can simply Oct 23, 2014 · Just take the unity example reflective water asset and trim out what you don’t need. The benefit of this is that now you can make any changes you want to this object's material, without unwanted effects on other objects that use the same material, and without inadvertently saving runtime Sep 4, 2014 · GetComponent<Image>(). matrices). In this tutorial you will learn how to use images to texture materials to place on Game Objects. The control is similar to the Image control, but offers more options for animating the image and accurately filling the control rectangle. If you know how to fix it, or have something better we could use instead, please let us know: You've told us there is information missing from this page All the parameters of a Material that you see in the inspector A Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. We also use a texture with transparency. You can easily convert a texture to a sprite using Sprite. So my question is - how do you save a material? Is it as simple as a binary serialization of the The Image control displays a non-interactive image to the user. Abs( Mathf. I found only how to load external images for texture2D. 3 KB august_unity496 August 26, 2019, 9:31pm 5 I figured how to make it tile without having to change it for each object. GetKeyDown…. Apr 17, 2019 · Making material transparant in Universal RP Remy_Unity April 17, 2019, 11:57am 2 You can’t dynamically create a transparent material for optimisation reasons (toggling the surface type to transparent in the editor will trigger defines in the shader to change how it is compiled). I’d like to save these materials to disc (basically caching them). To create a new Material, use Assets->Create->Material from the main menu or the Project View A view that shows the contents of your Assets folder (Project tab) More info See in Glossary context menu. Load < Texture2D > (“texture01”); I am attempting to set a material to a game object in my game, I created the object in script so I dont have the option to set it manually through unity. ). Transformation of 2D images into textured 3D meshes, available both in Editor and in The Raw Image control displays a non-interactive image to the user. Load) but this don´t have a material. Mar 6, 2025 · Easy Material & Texture Assigner Manually assigning textures to materials in Unity is frustrating and time-consuming. See Creating and using Materials for more information. 6 I want to change the UI image in random order. bmp extension in a resources folder and write color data to that in the png format and load that file through script by using var texture = Resources. You’ll complete this mission by creating a still life composition in which you can demonstrate a variety of shaders and materials. None of these approaches did work, and I suspect something Feb 2, 2018 · You might be able to create a file with . CreateAsset (the example creates a material, btw) Create scripting logic visually Visual scripting in Unity helps team members create scripting logic with visual, drag-and-drop graphs instead of writing code from scratch. A shader can create the look of glass or other clear substances by adding a specular reflection and a little bit of a tint to an otherwise transparent mesh. This allows you to modify Nov 22, 2012 · Next, create a new material by right clicking in your project window. More info See in Glossary window are accessible via script, giving you the power to change or animate how a material works at runtime. _EmissionColor: the emissive color of a material. How a Gameobject is rendered in Unity Any Gameobject is visible in the game only if some type of renderer is added to it. The following method generates a 16x16 Texture2D and applies it. It doesn’t have a sprite, because the material provides all the required visual information. You can only create shaders that operate on Custom Render Textures by writing ShaderLab Unity’s language for Feb 8, 2019 · Hello, basically I have a code, that detects (simple trigger detection) if a player is under an object (table, bed, …). This page describes how to create a custom post-processing A process that improves product visuals by applying filters and effects before the image appears on screen. More info See in Glossary effect with Volume support. You can tweak If you have a script which implements a custom special effect, you implement all the graphic setup using shaders & materials. material. To assign a shader A program that runs on the GPU. my cod The Unity Manual helps you learn and use the Unity engine. If it is, it sets that objects material to transparent. time * 2) ) ); The only problem is, that I am running in a performance issue, if there are many objects, that blink. After creating the material, use SetColor, SetTexture, SetFloat, SetVector, SetMatrix to populate the shader property values. I can save the scene, leave the scene and return to the scene, and the Emission property Jul 6, 2016 · The problem with your updated script: You pass values above 1. com Unity - Scripting API: AssetDatabase.