> Are these values that are viewer position dependent, or are theySunlight values are treated as vector-valued field dependent on coordinate position (internally in coordinate system based on (up, sunward, perpendicular to both)), thus
> constant for a given altitude and sun angle? I could imagine ways in
> which the calculation could be simplified if you are now able to get
> good results interpolating over polygons; you could also store the
> interpolated values or some component of them in the renderer's G-Buffer.
light_diffuse = rgb(x,y,z)
light_ambient = rgb'(x,y,z)
What is known about these fields a priori is that they're smooth and have smooth derivative, vary slowly in (xy) - the full transition from night to full intensity white light is more than 1000 km - and somewhat faster in altitude. There's no dependence on viewer position or view direction.
The slow variation means that for vertices which are a few hundred to a kilometer apart, a linear interpolation approximates the function with very good accuracy.
My understanding is that where to evaluate it is largely a question of the average number of vertices per pixel. In the model shaders, the function is evaluated in the fragment shader because a faraway model with 10.000 vertices collapses into just a few pixels. For scenery without the OSM roads, the situation was such that evaluating it over the mesh vertices was still cheaper than per pixel, implying that there's probably less than one vertex per pixel under usual conditions. Ultimately, if we had meter-sized terrain resolution, I assume the situation would reverse and evaluating per pixel would be unconditionally cheaper.
Well, hence my idea of simply writing a dedicated effect for roads - if they drive vertex count up, then work them per pixel.
I guess deferred rendering can in principle do these computations as part of the geometry pass and buffer them - I was given to understand (by Emilian) that for Rembrandt as it stands they would have to go into the fragment shader though.
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
Flightgear-devel mailing list