I am writing a simple fog shader in order to add some heavy fog to my game silent hill style. I am attempting to add an attribute to a script to control the fog color, but I keep getting this error:
Here is how I add the attribute:
Fog.attributes.add( 'fogColor', { type: 'rgb', default: [0, 0, 0], title: 'Fog Color' } );
However, when I define fogColor
in the initialize function of the javascript portion of the shader instead of as an attribute, like this:
this.fogColor = [0,1,0];
The shader runs fine. Shouldn’t they act the same?
Here is the project if needed.