Tag Info

Hot answers tagged

3

In the Unity docs under shader references. Shadow mapping macros Declaring and sampling shadow maps can be very different depending on the platform, so Unity has several macros to help with that: UNITY_DECLARE_SHADOWMAP(tex) - declares a shadowmap texture variable with name “tex”. UNITY_SAMPLE_SHADOW(tex,uv) - samples shadowmap texture “tex” at given ...


3

You're doing it wrong - very inefficiently. Instead of rendering lightsources to your "lighting framebuffer", render the lighting contribution. That would be a soft disk centered at your light source instead of a single pixel. Example disk: ... and you can render that as a sprite! (Additive blending, clamp to 1 for best results). You can now bind that ...


2

The basic difference is simple: The standard Rendering pipeline configures the GPU so it processes data as vertices, then rasterizes them into points/lines/triangles, and then processes the result as pixels which are written into a buffer using optional blending. A DirectCompute shader just takes data from a buffer and then process them in parallel to ...


2

The best way of passing such data to the GPU, using the shaders pipeline, would probably be with a texture. Knowing that, your own question answers it: A texture with one pixel for each node of the tree.


2

Hardware has not always supported floating-point texture formats. In fact, D3D has not always supported depth textures. When you see this sort of thing, it is usually because the application is trying to support an older API or older hardware. To store depth on these systems, they must be converted to fixed-point and packed into 4 channels of a traditional ...


2

From the OpenGL wiki: The input_primitive​ type must match the primitive type used with the drawing command that renders with this shader program. Given, Unity is probably using DirectX on Windows, but the same thing should hold true. Because your shader is asking for a point, it is only taking the first point from each primitive and ignoring the rest. ...


1

Yes, sending your mesh data to the GL every time you render it would be very wasteful. You should only be doing that if your data has changed from one frame to another (e.g. you are computing animations in the CPU). Otherwise, you shouldn't have to re-submit data if the model/mesh was not changed. Apparently, the problem with your program is that you are ...


1

The individual invocations within a work group will be executed "in parallel". The main purpose of the distinction between work group count and local size is that the different compute shader invocations within a work group can communicate through a set of shared​ variables and special functions. Invocations in different work groups (within the same ...


1

You only have a set of 16 possible textures per-shader stage, so way 1 may get out of hand quickly. You have up to 80 possible unique binding locations in GL4 (16 * 5 stages = 80) and 48 in GL3 (16 * 3), but you can only use 16 of those in a single shader invocation. In truth, bindless textures, array textures and texture atlases have all been designed to ...


1

First draw your bubbles with basic shader to RenderTarget2D texture. Next draw sprites shat should be blured with custom shader and pass it as BlurMapTexture paramether. In this shader add sampler for blur map: texture BlurMapTexture; sampler2D blurMapSampler = sampler_state { Texture = (BlurMapTexture); MagFilter = Point; MinFilter = Point; ...


1

The answer is spread across the following links. Due to size constraints / requirements it had to be a Buffer Texture. Overview listing of possible technologies: http://stackoverflow.com/questions/7954927/glsl-passing-a-list-of-values-to-fragment-shader OpenGL reference to Buffer Texture: https://www.opengl.org/wiki/Buffer_Texture Different question but ...


1

Why would you consider the wave disappearing unexpected? The shader averages/spreads differences in the heightmap. All it does is basically damping. Each iteration it will flatten out the waves, making them a little less high and a little wider. To have a more realistic wave-propagation you might want to try to use 2 textures. Use one for heights, and one ...



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