New answers tagged shaders
2
Similar to solution #3 in your answer, but perhaps a little cleaner in that no device state will be modified: you could create an ID3DXEffectStateManager that no-ops all of the operations, but tracks the index to which your dummy texture was assigned. (You could also use your custom state manager to snoop the sampler state settings.)
0
For refraction, you need to render the background to an offscreen buffer. Then draw it on screen. Finally you draw the water on top and pass the background texture into the water shader.
In GLSL you can use gl_FragCoord to get the onscreen coordinate of the pixel. You will have to divide by the background texture size to get the uv for the texture lookup.
...
0
Any idea or help about this shader effect ? I found a couple of idea but I don'r know if they are great : GPUGems - Refraction
5
A fragment pipe is a portion of the pixel pipeline that processes fragments. The more you have, the more you can parallelize fragment rendering. More is better, but like many things you get diminishing returns. You can learn more about the graphics pipeline here. The pixel pipeline is what's responsible for creating what goes in each pixel on screen, ...
0
I have Unity Pro. I saw that the best way to achieve such effect is to use Grabpass in the shader. But there are two problems with this system :
It seems that Grabpass is quite heavy for mobile as said here Using Grabpass & IOS/Android devices . But as I am learning shader, I don't know any other system to create refraction.
There is an issue with ...
0
The problem is the texture coordinates. Ogre store the data in attribute vec4 uv0; So in the vertex shader:
gl_Position = mvp_matrix*position;
texCoord = uv0.st;
Solve the problem
2
Except the spluttering / water jets (seems to be done with particles) it looks like a displacement shader.
Check out this http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter19.html
It is in 3D but the theory behind it should provide helpful if it is that kind of water effect you look for.
2
Texture shaders actually does not exists on a GPU. They are just emulated in drivers. What it means is, that using them is very slow and you shouldn't use them in a real-time application like game.
If you looking for clearing textures just use clear function. If you want to create texture procedurally i do recommend binding it as a rendertarget and using ...
1
There is no need to initialize a constant buffer with default values, simply ensure you have created it initially by calling CreateBuffer() on the d3d device. You then have to call Map() before you can copy any data into that buffer, and then Unmap() to return control of it to the GPU. It is good practice to initialize object members to default values on ...
1
Model, View and Projection matrices are passed as uniforms to the vertex shader, which uses them to transform vertex coordinates and normals. Typically projection matrix is constant between frames, view matrix is calculated once per frame and model matrix is unique for each object. Model matrix is in world space. This is of course not the only way to do ...
3
Perhaps I´m over thinking it.
Yes, you are. Transformation being done in shaders is meant to be literal. "Transformation" in this case being the application of some transform to the various per-vertex attributes. Where that particular transformation comes from is generally irrelevant to the shader. It is given a transformation, and it applies it to the ...
4
Yes, you do need texture units when not using shaders; if you look at the evolution of graphics hardware this will be obvious as multitexturing predated the programmable pipeline.
The classic old-school use case is Quake-style lightmapping, and in fact if you look at the Quake source code you'll see that it used multitexturing (via the old ...
0
After close inspection I found that the line:
gl_FragColor = baseColor * ( lightColor + 0.25 );
is probably exactly equal to:
gl_FragColor = baseColor * ( baseColor + 0.25 );
when uniform sampler2D s_lightMap isn't being loaded into the program.
EDIT: This may or may not be because of the State Functionality of openGL es 2.0, but I wouldn't bet on ...
1
As far as I know, SFML doesn't provide own anti aliasing. Well, when you create a new window, there is an optional parameter for the anti-aliasing level. But this super-sample anti-aliasing is a default handeled by the graphics driver instead of SFML. You can easily get that with GLUT, too.
Internally, SFML doesn't use render to texture, I think. But there ...
-2
Anti-aliasing is little more than rendering at a higher resolution and scaling it down before putting it on the screen.
Have you considered rendering to a larger off-screen texture?
2
First of all, to create this kind of effect you're going to need more than 4 vertices. You can move the vertex positions around all you like, but a shape made with 4 vertices will only ever be a quadrilateral, not a shape with wavy sides like you've shown. You'll have to subdivide the shape vertically, at least, so that it has enough vertices along each ...
Top 50 recent answers are included
