Community Forum

Need some help with water plane appearing black

Forum Overview >> Editor

CategoryEditor
Created06.12.2020 21:40


Robbes 06.12.2020 21:40
Hi everyone

I have been tweaking an existing map and figuring out the Giants Editor as I go. I am trying to remake a waterplane that I accidentally deleted a few days ago. After setting up the plane (with freezed scale), assigning the Material NormalMap (water_normal.dds) + Shader (oceanShader.xml) and setting the values, my plane is completely black.

If I set the Custom Shader Variation to "simple", it works but then it doesn't have the soft edges and the see through + underwater fog. So I think it has something to do with the custom shader not applying correctly?

Also compared to the original map, it has Material set to "waterNoReflections_mat" in the drop down menu. Mine has "UnnamedMaterial". This dropdown shows no way to select a different one. Where can I set this Material?

I searched for the Material in the original map file and copied this over:

<Material name="waterNoReflection_mat" materialId="68" diffuseColor="1 1 1 1" specularColor="1 1 1" customShaderId="1178">
<Normalmap fileId="1177"/>
<Refractionmap coeff="1" bumpScale="0.1"/>
<CustomParameter name="bumpSpeedScale" value="1 0.2 0.02 1"/>
<CustomParameter name="underwaterFogColor" value="0.15 0.25 0.3 0.4"/>
<CustomParameter name="windScale" value="0.25 0 0 0"/>
</Material>

Now where can I make use of this?

Any help is appreciated.

Bilbo Beutlin (BBeutlin) 06.12.2020 21:56
The most common fault is missing "Tangents" (checkbox) in shape.

Robbes 06.12.2020 22:16
No that's not it. I had it enabled. Disabling it makes it invisible.

To give some additional info, it's just like what happens in this video:
https://youtu.be/KNXBDwGs96A?t=646
He selects the oceanShader and then the water plane is completely black. He then switches to Variation "simple" and uses that. However, I do not want to use "simple" because it has hard edges and no transparency. In the original map file, Variation is set to "None" but is working. Mine is set to "None" but is black.

Bilbo Beutlin (BBeutlin) 07.12.2020 00:49
The material "waterNoReflection_mat" is mostly used for decoration like small ponds, puddles.

Try with the usual "water_mat" of a default map.
It's probably easier if you edit the i3d in text editor instead in GE.

Robbes 07.12.2020 11:16
I did add it to the file via VS Code, however I'm not seeing it anywhere. I'm asking: where can I set this material inside Giants Editor after adding it to the file? In the Material Editing panel, there is Material with a dropdown that has "Unnamed Material" selected, however no other options are available.

Bilbo Beutlin (BBeutlin) 07.12.2020 11:49
In GE you cannot assign arbitrary material to a shape. This is done one step before in the 3D modeler.

However you can change a material by text editing the assigned material in the i3d's <Materials> section. The material name may not be unique, so you must make sure you have the right shape and material.
Within GE select the shape transform and memorize the node Id n (Transform -> Id). Then load the i3d into text editor and search for nodeId="n". This will give you the materialIds="..". Can be more than one. (These are the materials you can select in GE material window)
Then search within <Materials> section materialId=".." where you can edit its properties.

On the text way you can also add a new material and its files. Then make sure you use new unique Ids.

Robbes 07.12.2020 16:11
Yes man, YES! That's it!

1. Search for my "konaRiverPlane" in the file code
2. Copy materialId
3. Search for materialId="381"
4. Add <Refractionmap coeff="1" bumpScale="0.1"/>

Fixed! Thanks a ton.

For others, I added only that one line but if you want reflection too, you shoul add this line as well:
5. <Reflectionmap lodDistanceScaling="0.5" viewDistanceScaling="0.5" type="planar" scaling="1" refractiveIndex="1.03" bumpScale="0.1" shapesObjectMask="256" lightsObjectMask="16777216"/>

My material looks like this:

<Material name="water_mattt" materialId="379" diffuseColor="1 1 1 1" customShaderId="1169">
<Normalmap fileId="1168"/>
<Refractionmap coeff="1" bumpScale="0.1"/>
<CustomParameter name="bumpSpeedScale" value="1 0.2 0.02 1"/>
<CustomParameter name="underwaterFogColor" value="0.15 0.25 0.3 0.4"/>
<CustomParameter name="windScale" value="0.25 0 0 0"/>
</Material>

So what I did wrong is trying to add a new Material. What you need to do is edit the material that was assigned to your plane by Giants Editor. And you have to backtrace it through it's materialId. It will be named "UnnamedMaterial". You can change this name to whatever you want and then the dropdown will display that name.

Or you know, adjusting the materialId's of my plane would've worked too.


Note: Log in to post. Create a new account here.