Hot answers tagged

4

I have little experience using Unity directly, but I've been a level designer for years and a much easier approach rather than worrying about cutting holes into your terrain is to simply build up a C shaped ridge in your terrain for the size of your cave and then cover it with rock meshes to give it the illusion of a cave. Another approach is that you ...


4

I don't think this is going to be quite as easy as you'd like, that said you should be able to copy/paste the code below to get something going. There might be a better way to approach this, but as I see it you'll need 2 render passes. The first to render the scene to a low resolution to introduce pixelation, and a second to resample the low resolution ...


3

The effect you're going for is less of a pure hue shift and looks more like old-school palette shifting effect. On old hardware this was implemented by arranging the color palette used for the image such that there was a run of similar colors (for example, a series of blues increasing in saturation, in the case of your first image) and then shifting and ...


2

The lowest-effort way to get what you describe: far away objects are completely grey and close objects are in full color ...is to use fog, either directly through the Lighting settings for your scene (see the Fog entries at this link, no custom shaders required) or by using the legacy shader paths. Here's an example of what it looks like with ...


2

It looks like you're trying to draw a 40x40 pixel aqua colored square at (0.0, 0.0, 0.5), is that right? OpenGL producing no output is probably the most common symptom you'll run into. I immediately see several things that look a little off: Your shaders are requiring OpenGL 4.5. Are you sure your current OS/drivers/etc. implement OpenGL 4.5? You set the ...


2

If I'm reading this right, the answer seems to be right there in the continuation of that line: metallic - the metallic-ness (0 = dielectric, 1 = metallic). This is a linear blend between two different models. The metallic model has no diffuse component and also has a tinted incident specular, equal to the base color. (With the implication that ...


2

Changing shader properties for each camera You can accomplish this with a script on the camera. In my example I change the color but you can extend this idea to any property in the shader. [ExecuteInEditMode] public class CameraMaterialChanger : MonoBehaviour { public Color myColor; // color you want the camera to render it as public Material ...


1

(Not 5 minutes after posting this I found a solution. Might as well share it here if someone else is curious about this in the future.) It's possible to set the texture using Shader.SetGlobalTexture. For this to work properly I also had to remove the texture as a property of the shader. I have the following script attached to an object in the scene and it'...


1

BTW, I ended up solving this using a lightmap. My process was as follows: Generate a UV map for the mesh by packing all the triangles together using a simple scanline algorithm. Render the scene directly to the UV map instead of to the screen. This way, pixels are 1:1 related to texels. Render the scene again to the screen, this time using the generated UV ...


1

First you need to get your shader's output into a Texture2D, so create one of the appropriate size. You'll commonly want ARGB32 format and no mipmaps: Texture2D outputTex = new Texture2D(width, height, TextureFormat.ARGB32, false) If the content you want to save has already been rendered by a camera in the scene, you can skip ahead (although in this case ...


1

I am also looking for some code to make this conversion but..Only God knows why the code above is using that array indexes lol... Maybe he meant something like this? (in case other people wants to use the code too) PVector [] tUV = new PVector[3]; // 2d uv coordinates of the triangle vertices PVector [] t3D = new PVector[3]; // 3d space ...



Only top voted, non community-wiki answers of a minimum length are eligible