Tag Info

New answers tagged

0

I think I can answer my question now. By putting the lights, the plane, and the box into different layers (labelled: background, midground, foreground respectively), we can use different cameras to render the objects in any order we want. Setting the depth of background to -1, midground to 0 (I want to do some more trickery with this layer later), and ...


0

Have you tried flipping it back in the shader? float4 Tex2D0=tex2D(_GrabTexture, float2(Add2.x, 1.0-Add2.y));


0

It's definitely achievable. Having never attempted it or anything, or really even tried all I could find was this link. I'm hoping it'll help you, as I look forward to trying it.


0

You need to tweak the shader file. Most probably there will be calculations based on the z axis. You need to take out all the z axis consideration from the calculation. For Example:- o.pos.xy += offset * o.pos.z * _Outline; Change to o.pos.xy += offset * _Outline; As every shader is different, I don't know if it will work for you, but it definitely ...


1

Figured it out by looking other shader examples and hopefully it will benefit others. elapsedTime can be added to the computation or offset and will animate the effect, some use sin/cos as well.. uniform float elapsedTime;


1

I found that replacing v_texcoord0 with gl_FragCoord.xy / vec2(screen_width, screen_height) in the SSAO shader, solved this issue.


0

This is achievable , what you need is Unity water and some script to simulate buoyancy. You can find the script in this link:- http://forum.unity3d.com/threads/buoyancy-script.72974/ Note:- You might also need to use some particles or mesh to fill the volume of the water. As unity water is restricted only to the surface and not the entire volume :)


1

In the context of a highly parallelizable section of execution, like drawing pixels to the screen rendered from a some 3D/2D scene, GPUs are almost always likely to be faster because of their architecture. The decision, in a broad sense, for what programs will execute faster on a GPU vs. CPU should be thought of as how many different execution contexts can ...


2

Try turning off backface culling. In your shader, put "Cull Off" in the "SubShader" section.


0

Here is how I would do it : Modify the material used by the terrain rendered with first camera to enable alpha blending (Blend SrcAlpha OneMinusSrcAlpha). So now the fragmentshader needs to output something to the alpha component (gl_FragColor.a, or the equivalent in Unity), for now use 1.0. Modify the vertex shader to compute view space depth and store ...


2

You can use #include files in your shader source files, this is described here. So like this you can regroup any common code into functions, which you put in an include file.


0

When using Unity 5 and the Standard shader you need to use "_EmissionColor" rather than "_Emission" to set the Emission value.


0

StretchRect function does not execute the pixel shader. Instead: Set up your render target and draw a polygon to cover the entire screen. This is the common way to perform a "full screen shader" pass. Anecdotally, My personal recommendation is to investigate the Compute Shader.


1

Some ideas: You could ignore the issue, and do what you're currently doing. Assuming those texture and shader comparisons are to OpenGL IDs (which are just integers), it's unlikely those checks are going to create a huge performance bottleneck. Comparison of integer values on modern CPUs is rather fast. Unless your profiler has told you this is currently a ...


1

The way to do this is with a FBO (Frame Buffer Object). You can render each pass to a FBO and use it as a texture input in the next stage, any kind of deferred shading and post processing is reliant upon this functionality. https://www.opengl.org/wiki/Framebuffer_Object


1

I used this solution to make a water distortion effect. You could use the sin waves vertically instead of horizontally to possibly achieve your effect. I draw what might get distorted onto a FrameBuffer. I make regions of the buffer texture that will be redrawn with a distortion shader applied. GdxGame.java void create(){ scaleX = ...


0

You're mixing terms and techniques here, a 2D-Texture has no z-dimension. What you actually want for your normal-mapping is to fetch the texel t from the image using the usual 2D texture-coordinates and use these color-values t.rgb as a normal-vector.


2

Figured I had the shader versions too high (vs_5_0/ps_5_0) lowering them to their 4_0 variant fixed the error.



Top 50 recent answers are included