Naman22's blog

Archives for: 2013

2013-09-26

Shader Weaver

Shader weavers are intimidating at first mainly because it is difficult to debug them and connections are quite confusing.
The basic idea of weaver can be learned from here. However, the code written in it is outdated... better to go with code.

Following are some weaver debugging techniques that I learned.
1. Debugging by altering the output color. ex

a. simplest way is to delete the shader plugin that isn't needed.
b. Disable GLSL only :
-cfgset=Video.OpenGL.UseExtension.GL_ARB_shader_objects=false
c. remove/edit the GLSL/CG technique in main entry weaver.

As for 1). I tried to port the code, but I'm kinda still struggling to get it right. Thanks to res, Rlydontknow and Sueastside I'm able to understand them quite well but still weird errors priest.

The Mismatching actually didn't existed in temporary weaver code. so I guess the complete weavers should fix this issue.

The values of CELL_WID, CELL_LEN and MAX_OCEAN_DISTANCE are increased to spread the ocean even wider. but they increased the pre-computation of LODs thus the "gran" (vertex per tile) had to altered accordingly. gran = pow(2.0,LOD_type)/64.0f;

FFT needed VS texture mapping, but weavers weren't complete at the moment. So I decided to give it a shot in old shaders. If you look at the FFT implementation then you'll find that FFT is essentially creats a complex "texture". FFT calculations are very heavy. Thus it would rather be easier to just take a heightmap and use for ocean waves. It actually gives pretty decent result.

Along the way I found that the ocean water move along the camera which shouldn't happen because in a game water usually stays at one particular position. It does that due to LOD calculations. So along with taking waves parameters from the world file, the plugin will also take position and radius to which the user wants it to extend.

2013-06-07

GSoC 2013

Hi,
This Summer is going to be really exciting. I'm gonna beat the heat by mutating the CS water system. Thanks to CS community for considering my proposal on water simulation. Watch out for Wet CS!
starting with shaders. ;)