# Enjoy

Member

37

355 Neutral

• Rank
Member

• Interests
Programming

## Social

• Github
https://github.com/suzdalnitski

3. ## Flowmaps distortion

I was able to solve the issue. In case somebody else encounters the problem, you just have to set the cycle to a much lower value. The optimal value for cycle is somewhere around: [CODE]cycle = 15.0f;[/CODE]
4. ## Flowmaps distortion

[quote name='Postie' timestamp='1355402409' post='5010175'] My guess is that setting the offset back to 0 when it exceeds the cycle length is the culprit. At faster flow rates the offset will overshoot by more than with a slower rate, so there will be a more obvious discontinuity. Try subtracting cycle from the offset instead of setting it to 0. [/quote] No luck so far... Any other ideas? Using higher resolution flowmap didn't solve the problem.
5. ## Flowmaps distortion

I've implemented flowmaps based on the following article: [url="http://graphicsrunner.blogspot.ru/2010/08/water-using-flow-maps.html"]http://graphicsrunner.blogspot.ru/2010/08/water-using-flow-maps.html[/url] For smaller values of flowSpeed everything is fine, but for larger values the water surface is getting extremely distorted. Is there any solution to this problem? Here's how do the FlowMapOffset calculation: [CODE] flowMapOffset0 += flowSpeed * Time.deltaTime; flowMapOffset1 += flowSpeed * Time.deltaTime; if ( flowMapOffset0 >= cycle ) flowMapOffset0 = .0f; [/CODE] Small flowSpeed: [img]https://dl.dropbox.com/u/16265778/Water_undistorted.jpg[/img] Large flowSpeed: [img]https://dl.dropbox.com/u/16265778/Water_distorted.jpg[/img]
6. ## Tangent space rotation

You're right, reflection vector should be in world space, and not in tangent space.
7. ## Tangent space rotation

I'm trying to rotate a view direction vector in my shader into tangent space. I need this for cubemap reflections to work on an arbitrary normal mapped surface. However for some strange reason the resulting reflection is rotated by 90 degrees in the YZ plane. It used to work correctly until I introduced the tangent space rotation. I suppose that the rotated viewDir vector is rotated incorrectly by 90 degrees. What's the reason and how can I fix it? Here's a snippet from my CG shader: [CODE] v2f vert (appdata_tan v) { v2f o; o.pos = mul (UNITY_MATRIX_MVP, v.vertex); float3 binormal = cross( v.normal, v.tangent.xyz ) * v.tangent.w; float3x3 rotation = float3x3( v.tangent.xyz, binormal, v.normal ); o.viewDir = mul (rotation, ObjSpaceViewDir(v.vertex)); } fixed4 frag (v2f i) : COLOR { half3 refl = reflect( normalize(i.viewDir), half3(0.0, 1.0, 0.0) ); refl.x = -refl.x; texcol.rgb = texCUBE( _Cube , refl ).rgb; return texcol; } [/CODE]
8. ## Velocity of a rolling ball

Hello, I need help with calculating angular and CM (center of mass) velocity of a rolling ball. The ball is rolling on an inclined surface. What I have: - CM velocity (velocity of a ball itself) - Angular velocity ( w ) - Coefficient of friction ( coeff ) - Normal of a plane What I need to get: - New velocity of center of mass (ball itself) - New angular velocity I have already implemented collision detection and collision response (only calculating new velocity of a ball after collision, based on restitution). But I can't figure out how to make the ball roll properly on the surface. I want to take into account sliding of a ball (if tangent velocity + ball velocity is not equal to 0 then a ball slides on the surface) Thank you in advance.

10. ## OpenGL Index buffer in OpenGL

Hello, How is an index buffer in OpenGL organized? I understand, how vertex arrays are passed to OpenGL, but I don't understand how to explain OpenGL, which vertex corresponds to which triangle. For example, I need to pass a square. How could this be done, using index buffers? Thank you in advance, Ilya.
11. ## Joining points into ITN

Hello, Is there a fast way to join points into Irregular Triangulated Network? I need an algorithm, that will enable me to do it in real time. Many thanks, Ilya.
12. ## bottom-up terrain

Hello, I am interested in bottom-up terrain LOD algorithms. Where can I read something on this topic? I found only up-down algorithms, where patches are being subdivided into triangles, basing on a needed LOD. I need something reverse - points are being joined into triangles. I hope everything is clear.
13. ## Cloudy fog

Hello, I need to create an effect of volumetric fog. And I want it to be "cloudy". Something like on this image: http://www.gebauz.com/uploads/images/screenshots/pentag/pentag05.png How could this be done?
14. ## Orientation in code

BeauMN, thank you, I will consider your advices and review my architecture. Also thank you for a link. I will try it. I am using c++, working under XCode in MAC OS X.
15. ## Orientation in code

Hello, I am working on a project and it is getting big. For now I have around 5000 lines of code and 20 source files. It is getting really hard for me to orientate in my code - to add a new feachure or just to update something. Really hard to find what I need in that huge classes. I want to know if there is some software, that could help me or an article. Something that could help me. Thank you in advance, Ilya.