diff --git a/TODO b/TODO index 3c0ec2c..f91f469 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,6 @@ Technology Preview 2 : +- When adding a texture layer (and maybe clouds), noise components cannot be used (they are always flat). +- Texture preview is sometimes all black. - Render tab previews should not rerender when changing render options. - Compute shadows only once for all textures at a same location. - Add antialiasing option (pay attention to memory usage). diff --git a/gui_qt/formtextures.cpp b/gui_qt/formtextures.cpp index 4dfb0c4..14021a9 100644 --- a/gui_qt/formtextures.cpp +++ b/gui_qt/formtextures.cpp @@ -95,6 +95,8 @@ public: _renderer.camera_location.y = 20.0; _renderer.camera_location.z = 0.0; + _zone = zoneCreate(); + configScaling(0.1, 10.0, 0.1, 1.0); configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0); } @@ -110,6 +112,7 @@ protected: void updateData() { texturesLayerCopyDefinition(&_layer, &_preview_layer); + zoneCopy(_zone, _preview_layer.zone); } private: static Color _applyLightingToSurface(Renderer* renderer, Vector3 location, Vector3 normal, SurfaceMaterial material) @@ -117,6 +120,7 @@ private: return lightingApplyToSurface((LightingDefinition*)renderer->customData[0], renderer, location, normal, material); } + Zone* _zone; Renderer _renderer; TextureLayerDefinition _preview_layer; LightingDefinition _lighting; diff --git a/gui_qt/paysages-qt.pro b/gui_qt/paysages-qt.pro index ab6e567..d81380c 100644 --- a/gui_qt/paysages-qt.pro +++ b/gui_qt/paysages-qt.pro @@ -8,6 +8,7 @@ MOC_DIR = ./moc/$$BUILDMODE/ DESTDIR = ../build/$$BUILDMODE/ CONFIG += $$BUILDMODE +LIBS += -lGLU unix:LIBS += -L$$DESTDIR -lpaysages win32:LIBS += ../libpaysages.a -lDevIL -lILU -lILUT -lglib-2.0 -lgthread-2.0 diff --git a/gui_qt/widgetwanderer.cpp b/gui_qt/widgetwanderer.cpp index 144a223..e41d891 100644 --- a/gui_qt/widgetwanderer.cpp +++ b/gui_qt/widgetwanderer.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "../lib_paysages/scenery.h" WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera): diff --git a/i18n/paysages_fr.ts b/i18n/paysages_fr.ts index c4b233d..5f0388f 100644 --- a/i18n/paysages_fr.ts +++ b/i18n/paysages_fr.ts @@ -499,7 +499,7 @@ Maintenir Ctrl : Plus rapide FormTextures - + Coverage preview Aperçu de la couverture @@ -508,77 +508,77 @@ Maintenir Ctrl : Plus rapide Rendu en couleur - + Lighted sample Echantillon éclairé - + Surface noise Bruit de surface - + Surface noise height Hauteur du bruit - + Surface noise scaling Echelle du bruit - + Base color Couleur de base - + Light reflection Réflexion de lumière - + Light reflection shininess Concentration de la lumière réfléchie - + Soft minimal height Altitude minimal (adoucie) - + Hard minimal height Altitude minimale - + Hard maximal height Altitude maximale - + Soft maximal height Altitude maximale (adoucie) - + Soft minimal slope Pente minimale (adoucie) - + Hard minimal slope Pente minimale - + Hard maximal slope Pente maximale - + Soft maximal slope Pente maximale (adoucie) diff --git a/lib_paysages/render.c b/lib_paysages/render.c index 1955403..6cf535c 100644 --- a/lib_paysages/render.c +++ b/lib_paysages/render.c @@ -33,7 +33,7 @@ struct RenderArea RenderCallbackUpdate callback_update; }; -/*#define RENDER_INVERSE 1*/ +#define RENDER_INVERSE 1 #define RENDER_WIREFRAME 1 static void _callbackStart(int width, int height, Color background) {} diff --git a/lib_paysages/shared/types.h b/lib_paysages/shared/types.h index 0905215..e021adc 100644 --- a/lib_paysages/shared/types.h +++ b/lib_paysages/shared/types.h @@ -86,8 +86,6 @@ typedef struct double shininess; } SurfaceMaterial; -typedef struct Zone Zone; - typedef void (*RenderCallbackStart)(int width, int height, Color background); typedef void (*RenderCallbackDraw)(int x, int y, Color col); typedef void (*RenderCallbackUpdate)(double progress); diff --git a/lib_paysages/textures.h b/lib_paysages/textures.h index 07feb73..ec87f5e 100644 --- a/lib_paysages/textures.h +++ b/lib_paysages/textures.h @@ -5,6 +5,7 @@ #include "noise.h" #include "lighting.h" #include "pack.h" +#include "zone.h" #ifdef __cplusplus extern "C" { diff --git a/lib_paysages/zone.h b/lib_paysages/zone.h index 45a31d0..c9c4b25 100644 --- a/lib_paysages/zone.h +++ b/lib_paysages/zone.h @@ -8,6 +8,8 @@ extern "C" { #endif +typedef struct Zone Zone; + typedef struct { double value;