Tag Info

New answers tagged

0

As discussed in the comments above, it may be easier to get this effect (and scale better to large values of N) by flipping the request around. Rather than the shader for the scene geometry checking - in every rendered fragment - its distance to each of the N points, we can instead draw the scene geometry normally, then "stamp" the effects onto it by ...


0

It appears there are syntax differences between HLSL for DX9 and DX11. I'm pretty such the above script was written for DX9, so it won't work as-is on DX11. http://stackoverflow.com/questions/2853997/directx-9-hlsl-vs-directx-10-hlsl-syntax-the-same


0

Thanks for all the feedback! DirectCompute is a good start, but it appears some things that were said were inaccurate. http://stackoverflow.com/questions/2853997/directx-9-hlsl-vs-directx-10-hlsl-syntax-the-same HLSL can run on DirectX9. Furthermore, there are syntax differences between HLSL for DX9 and DX11, and I believe the scripts I want to run were ...


0

Using only stencil will not help you if you want smooth fading of your clouds. Stencil (as the name suggests) is used to reject pixels which are masked out by it. When you draw your b/w alpha tile you probably setup stencil test so that if alpha!=0 then stencil passes, otherwise - fails. So you get what you asked for. When you later draw your clouds they ...


0

You were pretty much looking for the same thing I was, and I also found a solution using GLSL. I answered my own question here - GLSL 2D Silhouette - It's done using libGDX, but the solution should be adaptable to any engine with the same capabilities.


0

HLSL is the High Level Shader Language used by Direct X. HLSL Shaders are run on the GPU at runtime and can only be run by the CPU in a special debug mode inside of Visual Studio. HLSL requires a Direct X pipeline to be setup in your application. Visual Studio can compile your shaders for you but you have to load them and feed them to your pipeline. You must ...


0

I solved it! Here is the process I followed: Render Lower Tiled Map Layers Render Entities Render Upper Tiled Map Layers Render Upper Tiled Map Layers to stencil buffer Render Entities using the stencil buffer with a simple color fragment shader The code. Rendering the upper map layer: // Render the top map layer normally renderer.render(layerIndeces); ...


1

You need to check two things: 1.Texture and Shader ETC1 doesn't support alpha. You'd have to use a separate texture read (which you seem to be doing on texture2D(CC_Texture1, v_texCoord2). You can use tools to extract alpha channel from a RGBA texture and use a single texCoord for both samplers. Your code could be something like this: vec3 tex = ...


0

Of course right after I post this I realize what I did wrong: // Attach then link shaders GLuint shaderProgram; should be // Attach then link shaders GLuint shaderProgram = glCreateProgram();


1

gl_TexCoord[0].stp = normalize(gl_Vertex.xyz); Is your problem, I believe you need: gl_TexCoord[0].stp = normalize(gl_Normal.xyz * gl_ModelViewMatrix); Possibly without the matrix multiplier -- I'm a bit rusty. Note that the meaning of 'normal' can be a bit confusing here -- The 'vertex normal' (gl_Normal) is a vector pointing directly 'away' from the ...


1

I followed @nexx's comment. and made a 2 pass surface shader which give colors to hidden pixels. You can use built-in light function or Unlit version(commented). Hope this help for others finding this kinds of effects. Shader "Test/HiddenPixelColoring" { Properties { _MainTex ("Texture", 2D) = "white" { } } SubShader { ...


0

What you are describing is not occlusion. Your objects in the image are rendered but are overwritten by the other object because of a higher Z depth. What you are trying to achieve could be done using a shader that nexx mentioned earlier. For example this one could help you: http://forum.unity3d.com/threads/trying-to-make-a-silhouette-outline-shader.96005 ...


1

First, Effects 11 is deprecated, or rather the HLSL profile you need to use it (fx_5_0) is deprecated. You can use still it with the Windows 8.x SDK copy of D3DCompile, particularly if you are using the GitHub open source version of the FX11 library as long as you are comfortable with this caveat. You don't 'need' to use it, but some people have found it ...


0

After playing around with things, I've decided to use Blender's stencil map feature (which is a reduced sort of splat map). It allows me to blend between two tileable textures on the same surface using a third as a stencil without having to use huge textures. I also had to write a custom shader in unity to have my stencil material display, but that wasn't ...


-2

In general, you can't. The typical development environments only give you visibility on the C/C++ side. So, I say "you can't" but that's obviously not exactly true. You can't step through the shader and print variables, but still we all develop and debug shaders. But it's a lot of intuiting indirectly what's going on, by repeated runs. Some of the things I ...


8

You can try perlin noise (using a proper black/white gradient) , and then apply the right/left mirroring


13

To get that authentic inky look, your best bet is probably to assemble a library of images of ink splats, streaks, and dribbles. Then you can randomly select some number of them to position & rotate randomly over one-half the image. (With a bias toward the seam edge so the middle of the Rorschach test is densest. You might be able to use a particle ...


0

Two things others didn't mention: The ripples in the water surface are made by Bump-mapping, where you use a texture to add fake depth to your objects(a.k.a. Normal mapping). You could even animate this with noise, so you don't need a texture, just GLSL noise generation.(Quite simple and awesome effect) The very subtle "fog" around the planet might be a ...


3

Welcome to the tutorial to discooridnated chromatic effect. The above is an example of screen distortion. It is necessary to understand the first type of screen distortion in order to understand the final effect listed second. It is achieved by having screen coordinate texture then applying the altered screen coordinate when rendering the final scene. ...


0

I'm not sure if this method is completely possible with unity/shaders, but I think this is a method that could work. For each colour channel; define what I would call a "warp field". A "warp field" in this case would be a 2 dimensional array of Vector2s, with each element corresponding to a pixel on screen. (you could have this representation at a lower ...



Top 50 recent answers are included