- User Since
- Jan 23 2021, 5:08 AM (15 w, 5 d)
Apr 5 2021
@nani and @gameboy Friends, I totally agree it's a pity to have done so much work on these shaders and let it all go to dust; but it's really pointless to try to continue with it, with all the hate I got, and the monkey-wrenching. The fact is my contributions are not wanted. Period. If you look at the comments on this patch, back to the beginning, note what I'm being asked for: separate patches for each feature... !!! Like, how much time was I supposed to spend on this? It would take me weeks of work to separate this into 3 separate shaders, individually debugged and diffed. It's insane.
Notice also how many thoughts, reports and ideas I presented here, about blurring, about shadows; and I got no reply. Silent treatment is what it is.
So, if my work is never going to be accepted, there's no point in continuing. I stopped the C++ work I was doing too, for the same reason.
And I also stopped looking at the wildfire engine for my own purposes, since I would probably not get any help with modding it.
And so I also stopped playing 0ad, for good measure.
Apr 2 2021
Mar 2 2021
@vladislavbelov Sorry, never saw your comment until now. I'll see what I can do. The problem with shaders is that often the order that operations can be applied is not as originally envisioned. Case in point the dimming of sunlight entering the water is done at the end of the pipeline, which is neither here nor there since the order of multiplicands is invariant, but makes isolating concerns more difficult. Off the bat,
The water_high.fs shader was starting to slow framerate on my old videocard, so I looked for ways to optimize the code.
This first step is to move the sun-dimming factor for sunlight refracting into the water; namely the ndotl calculation, where n is 0,1,0, and the fresnel calculation for refraction. The product of fresnel refraction and ndotl is written to a varying called "sun_dimming_factor", such that water_high.fs now only has to compute Fresnel once.
Mar 1 2021
I'm sorry; I thought that converting tabs to spaces was going to help, but it seems the original file had tabs. Should I convert double-spaces back to tabs? Let me know.
In the meantime, I have a suggestion without any preconceived idea who would be implementing it, if at all; of course my willingness is absolute.
The idea is to expand the water shader to include stuff that floats on water, such as water-lilies --as are found in Belgian Bog.
I think the engine could programmatically separate floaters and send them to the water shader as a separate texture.
The benefits of doing so are that the water shader could then,
a) rock the floaters as per the water waves' normal ((they look odd being still when the water is waving)), and
b) move them around slightly, by using texture offsets on the floaters texture, to represent wind.
The texture offsets could be related back to the numbers controlling trees' motions representing wind.
Improved the hack for wet-looks of coasts.
Fixed the refractive factors in and out of the water: Now sunlight penetration is modulated by fresnel refractive factor based on ndotl, while light from the sky is not modulated going in. Upon coming out of the water, light is modulated again by fresnel refractive factor based on ndotv.
Screenshots in this post:
Got rid of Schlick's Approximation and implemented true Fresnel from Wikipedia.
Obtained RGB refractive indexes for seawater and freshwater; presently sea-water is used.
Found another mistake: Refracted light was not multiplied by (1-reflection_factor); now it is.
Commented out my previous attempts to mix scalings and orientations of the wave animation; they were
causing the appearance of fine ripples, not sure why.
Made the wet coasts feature more subtle.
Fixed problems with there being tabs instead of spaces.
For screenshots, check this forum post:
Feb 27 2021
Solved the problem of reflections being too faint.
Solved a problem with artifacts on land; it yielded to a number changed in the Schlick approximation from 1.0 to 1.15.
Found another mistake: The refracted bottom had no incident lighting computed; it was essentially an emitter.
Added a hack to make coasts exhibit a darker band resembling wetness. It was at the cost of draining some of the water (lowering the level, optically).
Added crossing waves at 90 degrees with different scaling, to try to break or hide the tiled look of waves.
EDIT: Thanks, Gameboy; missed your comment.
For a screenshot, see this post:
Feb 24 2021
Feb 18 2021
Moved declaration of half vector out of conditional compile switch in model_common.vs; also swizzled lines 133 to 137 to correct dependencies.
Took the exporting of the half-vector out of any conditional switches in model_common.vs.
Minor code optimization in model_common.fs; saved one sqrt() call.
Change name of function "get_white_dimming_factor(tex)" to "get_needed_white_dimming_factor(tex)", in terrain_common.fs.
Fixed a few more comments not capitalized, or not ending with a period.
Removed leftover code from attempting to use skybox as enviromap.
More cosmetic fixes.
Carried on style fixes to the other shaders.
Figured out how to diff from root while skipping /sources.
Updated the patch again after fixing style 'mistakes' at Stan's request. What I was not able to do is diff from the root folder, as then svn diff wants to include all the stuff from sources, which amounts to more than two megabytes. I'm sure there must be a command to skip a folder, but I was a Tortoise user for many years; never learned the command line.
Feb 17 2021
Jan 28 2021
Optimus, I didn't even know I could use svn inside subfolders. I used svn before, for two years, but
it was through a gui, and all I did was check out and commit.
So, I tried making a diff, but I forgot that my code's current state is far from compiling.
I'm turning all the vector classes (AND my point classes below them) into template classes, where the
template parameter is a "Frame of Reference" abstract type, so as to prevent, for example, subtracting a
screen-coordinate vector from a terrain point and interpreting the result as a mini-map coord. Mixing
frames of reference won't be allowed except through deliberate channels. Here's a sneak preview:
Jan 23 2021
- Removed comments.
- Fixed the tabs that were spaces issue, courtesy of CodeLite
- Added alignment directives
- Removed padding member
- svn diff'ed from the instructions in the wiki