> Instead there are two shadings taking place:
> 1) Shading based on distance of the sprite to the sun. Effectively
> we compare a vector from the center of the cloud to the sprite location
> with the light normal.
> 2) Shading based on the vertical placement of the sprite in the cloud, so
> lower sprites are shaded more. This is controlled by the
> <bottom-shade> parameter.
>
> I suspect that it is the latter that is misbehaving. IIRC the
> bottom-shader is applied
> as a factor to the lighting, so using a value of (say) 0.1 should
> result in a dark cloud
> bottom.
Upon further reflection - could it be the problem that I'm trying to
assemble a layer rather than fill a volume?
The bottom shading in 3dcloud.vert is controlled by a combination of
'shade' and 'cloud_height'. Your Nasal interface doesn't provide an option
to set 'cloud_height' explicitly, so I'm assuming it's the box height
determined from 'min-cloud-height-m' and 'max-cloud-height-m' as used by
add-cloud.
Now, in assembling a layer, I want the box to be essentially flat, i.e.
just distribute textures on a layer with very little extension in
altitude, such that the layer thickness is determined by the size of a
single sprite rather than the box size, i.e. the sprite height is larger
than the box height. See my cloud definition code below (it's all written
into a hash first before the property argument for cloud-add is
assembled, but the parameter names are pretty similar - in case you're
wondering, z-scale is just for my reference what should be there later and
in my current experiments simply inserted into the shader by hand)
if (subtype == "small") {var mult = 0.7;}
else {var mult = 1.0;}
# characterize the basic texture sheet
cloudAssembly.texture_sheet = "/Models/Weather/stratus_sheet1.rgb";
cloudAssembly.num_tex_x = 3;
cloudAssembly.num_tex_y = 2;
#characterize the cloud
cloudAssembly.bottom_shade = 0.4;
cloudAssembly.n_sprites = 20;
cloudAssembly.min_width = 1800.0 * mult;
cloudAssembly.max_width = 2200.0 * mult;
cloudAssembly.min_height = 1800.0 * mult;
cloudAssembly.max_height = 2200.0 * mult;
cloudAssembly.min_cloud_width = 2200.0 * mult * mult * mult;
cloudAssembly.min_cloud_height = 50.0 * mult * mult * mult;
cloudAssembly.z_scale = 0.5;
Case in point - while min_cloud_height is just 50 m, the height of a
texture sheet is 900-1100 m (originally twice that, but z-rescaling
shrinks it again).
I'm suspecting that somehow the shader doesn't expect that. Maybe cloud
height as passed to the shader should be max(box_height, texture_height)?
Or an optional parameter? In clouds_layered.vert, a hard-coded value of
1000 m works fine.
* Thorsten
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel