Using GbxFluidSurface

From BiaSDK
Jump to: navigation, search

'GbxFluidSurface' is the Gearbox replacement for the Unreal's FluidSurface* Actors. Due to time constraints, only procedural water is supported, but shaders for animated vertices might be implemented at a later date. The water is a basic bumpmapped/reflective surface with animated bumpmaps.

To add water, just go into the 'Actor Classes Browser' and select 'Actor->GbxFluidSurface'.

In the editor window, right click and select 'Add GbxFluidSurface Here'.

After the Actor has been placed, there are some properties you'll want to edit before the water will work clearly.

The first property you'll want to set is the ProceduralShader to use as a source for the wave texture. This will be a GbxShaderMaterial cloned from the t_gbxshader.RenderTargetEffects.Example_RTE_Water material. To create a clone of the t_gbxshader.RenderTargetEffects.Example_RTE_Water material, go into the GbxShaders Browser and open the t_gbxshader.RenderTargetEffects.RTE_Water material located in the shader list on the right side of the browser dialog. Here you will see the default example material. Right click on it and select clone. A new material called t_gbxshader.RenderTargetEffects.MyRTE_Water0 will appear.

109 GbxFluidSurface3.gif

There are a few parameters here thatneed to be set before we move on.

In the Texture Assignments view located to the right of the shader list, you will see a few things. The only things of interest here are the Texture list under GbxEdit Texture and the Tweakable Values view.

If you click and open the GbxEdit Texture list, you will see space for two textures. These should be some really cool bump map provided to you by some really cool artist who knows how to do that kind of stuff.

110 GbxFluidSurface2.gif

The next few parameters you see are under tweakable values. For this particular shader, the only one you should modify is the 'bumpSpeed' parameter. Double clicking on this variable will bring up the following dialog box.

[[File:111 GbxFluidSurface4.gif

The left side contains a list of Custom Values and the right side contains a list of Default Values. The Default Values are taken from the t_gbxshader.RenderTargetEffects.Example_RTE_Water material. If you wish to override any of these, change the value in the Custom Values side. Make sure you also check the checkbox to the left of the value or your changes will not be applied.

In this particular shader, X and Y will modify the x and y speed of Texture[0] and Z and W will modify the x and y speed of Texture[1]. Ultimately, this will affect the look of your water in the game.

Now that youve done all that, it's time to assign the material you just created to the GbxFluidSurface. Right click on the GbxFluidSurface and click Edit GbxFluidSurface Properties. Open the GbxFluidSurface section and you should see a ProceduralShader variable. This needes to be assigned the material you just created.

112 GbxFluidSurface0.gif

Next, we'll need to assign some geometry to the GbxFluidSurface. Go to the Display section of the GbxFluidSurface Properties dialog and assign a static mesh.

113 GbxFluidSurface5.gif

One of the nice features of the GbxFluidSurface object is that it takes into account an alpha value (currently stored in the red channel due to ASE exporter limitations) that can be used to fade out the areas of the mesh adjacent to the shoreline. This gives a nice clean transition from the water geometry to the terrain/BSP geometry.

After you assign the static mesh to the GbxFluidSurface, you'll need to apply a material to the static mesh. Go into the 'GbxShaders Browser' and look for t_gbxshader.StaticMesh.STM_WaterBumpEnvReflection. Clone this shader just like you did the t_gbxshader.RenderTargetEffects.Example_RTE_Water material earlier.

In the texture assignments view, there are four textures. We are concerned only with the fourth one. The first texture is set internally to the material assigned to the ProceduralShader property we set previously, and the second and third textures must remain 'None'. The fourth texture should be set to an artist supplied environment map.

After you've set all of the parameters for this material, select it as the active material by going into the 'Textures Browser' and select the MySTM_WaterBumpEnvReflection0 (or whatever you named it) under the t_gbxshader->StaticMesh section.

Now, go into the 'Static Meshes Browser' and select the static mesh you used earlier, and assign the material to it. That's it, you're done!


Back to Main Page