Tag Info

New answers tagged

3

You might want to look into fur shading technique. This is what I would use for this type of grass, since the shorter the grass is the better the performance (less layers). Basically it works by layering the same surface multiple times in small increments: You can also change the horizontal offset to make the grass look bent.


0

WebGL is based on OpenGL ES. Precision qualifiers (like "precision mediump float;") were introduced in OpenGL ES to optimize performance on embedded systems with lower hardware (like smartphones). In desktop OpenGL these precision qualifier do nothing. They only exist for compatibillity to OpenGL ES / WebGL. Source: ...


0

Ok, found it. It sits in shader inputs, here is the shader that works: float4x4 Projection; Texture2D FontTexture; sampler TextureSampler = sampler_state { texture = <FontTexture>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = clamp; AddressV = clamp; }; struct VertexShaderInput { float4 ...


1

No, that's not how shaders work. If you want to use a shader to manipulate a texture, you need to set up a render-to-texture operation. Create a result texture, bind it as the render target, bind your input texture as a regular input texture, and bind the shader you want to execute "once." Render a fullscreen quad mapped with the input texture using the ...


0

no, you cannot stop shaders. That would break the render pipeline and as a result you would break rendering. Doing such a sweep is simply setting the uniforms to the needed values from your application (for ex. incrementing the texture position values on each iteration). Inside your application, you know the size of the underlying object and can stop using ...


0

Answer: IDirect3DDevice9::SetTexture


0

I had exactly this problem. To verify my operations to the framebuffer, I was drawing the framebuffer texture back to the screen using a simple GL_QUAD. But it was not giving correct output since I was not setting glUseProgram(0) before drawing that quad. So the correct sequence of operations goes something like this: glBindFramebuffer(GL_FRAMEBUFFER, ...


1

You can use CheckDeviceFormat to determine if a given D3DFORMAT is suitable for the device's backbuffer; it's unlikely that particular format will be. Instead, try creating the device with any old acceptable backbuffer format (D3DFMT_X8R8G8B8 for example); it doesn't matter since you won't be rendering to it. Then create a new texture with the desired ...


0

It is most likely a shader that uses Parallax Occlusion Mapping, which uses normal map to "fake" depth and shadows in a texture. See HERE for examples. Edit: As @Leggy pointed out, it is perhaps more likely that it is displacement mapping since the foot seems to be going between the grass. Anyway, it is some sort of height mapping shader :)


3

It's probably multiplying the colours. That's pretty typical for a parameter like this. Each colour channel is interpreted as a value from 0 to 1, then multiplied with the corresponding colour channel of the tint colour. So: _______________ times red (1, 0, 0) = white (1, 1, 1) = red (1, 0, 0) grey (0.5, 0.5, 0.5) = ...


2

DXGI_FORMAT_R32G32B32_FLOAT is not 16 bytes, that's the first problem after a quick look. Either declare it 12 in your layout or specify D3D11_APPEND_ALIGNED_ELEMENT instead. Or Make it DXGI_FORMAT_R32G32B32A32_FLOAT instead depending on your matrix.


0

For performance reasons, the program treats boneMatrix as an array of float4 vectors rather than an array of float3x4 matrices. The matrixIndex array contains floating-point values instead of integers, and so the addressing of a single array of vectors is more efficient than accessing an array of matrices. There is definitely a performance ...


0

If you want 3D I gues one easy way of getting a velocity for a particle would be to input it's location into a noise function trice with a different seed for each one and then use the output numbers an x, y and z velocities. Another and better way would be to generate two random numbers with the method I mentioned before: rand1 and rand2 that will be ...


2

If you open the image above in its full resolution and look closely (with something like Magnifier on Windows), you should see that all the pixels simply have something like a blurred edge. Since there can be seen standalone "edges" of pixels, it is clearly not a post-processing method. When looking at screenshots in different resolutions, the edge ...


0

I found a solution. I cannot really explain why it changes the outcome since all UV's are in the [0;1] range. Yet, addin the lines glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); Just after loading the texture solved the problem just fine.


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 EDIT: After doing research, HLSL is supported both in DX9 and DX11. You generally pre-compile HLSL with ...


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 ...


1

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 = ...



Top 50 recent answers are included