paysages : Small explorer improvements.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@344 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-06-09 20:26:34 +00:00 committed by ThunderK
parent 19fb234a28
commit 0a0fe193a5
4 changed files with 54 additions and 26 deletions

View file

@ -1,14 +1,36 @@
????-??-?? Technology Preview 2
-------------------------------
* Previews scaling is now logarithmic (slower when zoomed).
* Previews drawing now takes advantage of multiple CPU cores.
* New texture model (perpendicular displacement and thickness).
* Added clouds hardness to light.
* Version management in saved files.
* Added ground texture and skybox in 3D explorer.
* 3D explorer now takes advantage of multiple CPU cores.
* Added sun halo control.
Previews :
* Scaling is now logarithmic (slower when zoomed).
* Drawing now takes advantage of multiple CPU cores.
3D Explorer:
* Added ground texture and skybox.
* Progressive rendering now takes advantage of multiple CPU cores.
Scenery :
* Added clouds hardness to light.
* Added sun halo control.
Rendering :
* New texture model (perpendicular displacement and thickness).
GUI :
* Improved curve rendering.
* New material editor.
Misc :
* Version handling in saved files.
2012-04-20 Technology Preview 1
-------------------------------
* First preview version.
First preview version :
* Ground with simple texture layers
* Water with waves, transparency and reflection
* Sky with sun
* Atmosphere with fog
* Cloud 3d layers
* Two-pass rendering
* Form-based GUI, with real-time previews

1
TODO
View file

@ -13,6 +13,7 @@ Technology Preview 2 :
- Add a terrain modifier dialog with zones.
- Use the curve editor in noise editor
- Add a noise filler (and maybe noise intervals ?).
- Add a popup when rendering is complete (with stats), except for quick render.
- Fix the distorted sun appearance.
- Improve curve editor.
=> Add curve modes

View file

@ -101,7 +101,7 @@ void ExplorerChunkTerrain::onRenderEvent(QGLWidget* widget)
double tsize = 1.0 / (double)_tessellation_max_size;
_lock_data.unlock();
if (tessellation_size == 0)
if (tessellation_size <= 1)
{
return;
}
@ -123,21 +123,21 @@ void ExplorerChunkTerrain::onRenderEvent(QGLWidget* widget)
double ExplorerChunkTerrain::getDisplayedSizeHint(CameraDefinition* camera)
{
double distance, wanted_size;
double distance;
Vector3 center;
center = getCenter();
distance = v3Norm(v3Sub(camera->location, center));
distance = distance < 0.1 ? 0.1 : distance;
wanted_size = (int)ceil(120.0 - distance / 3.0);
if (!cameraIsBoxInView(camera, center, _size, _size, 40.0))
if (cameraIsBoxInView(camera, center, _size, 40.0, _size))
{
wanted_size -= 500.0;
distance = v3Norm(v3Sub(camera->location, center));
distance = distance < 0.1 ? 0.1 : distance;
return (int)ceil(120.0 - distance / 1.5);
}
else
{
return -800.0;
}
return wanted_size;
}
Color ExplorerChunkTerrain::getTextureColor(double x, double y)

View file

@ -233,6 +233,11 @@ void cameraSetRenderSize(CameraDefinition* camera, int width, int height)
Vector3 cameraProject(CameraDefinition* camera, Renderer* renderer, Vector3 point)
{
point = m4Transform(camera->project, point);
if (point.z < 1.0)
{
point.x = -point.x;
point.y = -point.y;
}
point.x = (point.x + 1.0) * 0.5 * camera->width;
point.y = (-point.y + 1.0) * 0.5 * camera->height;
return point;
@ -323,10 +328,6 @@ int cameraIsBoxInView(CameraDefinition* camera, Vector3 center, double xsize, do
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
center.y += ysize;
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
center.z += zsize;
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
@ -335,7 +336,7 @@ int cameraIsBoxInView(CameraDefinition* camera, Vector3 center, double xsize, do
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
center.y -= ysize;
center.y += ysize;
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
@ -347,5 +348,9 @@ int cameraIsBoxInView(CameraDefinition* camera, Vector3 center, double xsize, do
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
center.x -= xsize;
projected = cameraProject(camera, NULL, center);
_updateBox(&projected, &xmin, &xmax, &ymin, &ymax, &zmax);
return xmin <= camera->width && xmax >= 0.0 && ymin <= camera->height && ymax >= 0.0 && zmax >= camera->znear;
}