[Bf-blender-cvs] [c7ef4704f9d] soc-2018-npr: Image filters ok, added ui adjustment(stub), prepared for vectorization.

Nick Wu noreply at git.blender.org
Wed May 23 16:50:54 CEST 2018


Commit: c7ef4704f9d5acd1f15cf31e82d9fa9683219a17
Author: Nick Wu
Date:   Wed May 23 22:50:18 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rBc7ef4704f9d5acd1f15cf31e82d9fa9683219a17

Image filters ok, added ui adjustment(stub), prepared for vectorization.

===================================================================

M	release/scripts/startup/bl_ui/properties_scene.py
M	source/blender/draw/CMakeLists.txt
M	source/blender/draw/engines/lanpr/NUL_TNS.h
M	source/blender/draw/engines/lanpr/NUL_TNS_EdgeRendering.c
M	source/blender/draw/engines/lanpr/NUL_Util.c
M	source/blender/draw/engines/lanpr/NUL_Util.h
R100	source/blender/draw/engines/lanpr/shaders/TNS_AtlasPreview.geometry	source/blender/draw/engines/lanpr/shaders/lanpr_atlas_preview.geometry
R100	source/blender/draw/engines/lanpr/shaders/TNS_AtlasProjectClip.fragment	source/blender/draw/engines/lanpr/shaders/lanpr_atlas_project_clip.fragment
R100	source/blender/draw/engines/lanpr/shaders/TNS_AtlasProjectPassThrough.vertex	source/blender/draw/engines/lanpr/shaders/lanpr_atlas_project_passthrough.vertex
R100	source/blender/draw/engines/lanpr/shaders/TNS_ImagePeel.fragment	source/blender/draw/engines/lanpr/shaders/lanpr_image_peel.fragment
R100	source/blender/draw/engines/lanpr/shaders/TNS_LineConnection.geometry	source/blender/draw/engines/lanpr/shaders/lanpr_line_connection.geometry
R077	source/blender/draw/engines/lanpr/shaders/TNS_SnakeEdge.fragment	source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge.fragment
A	source/blender/draw/engines/lanpr/shaders/lanpr_snake_multichannel.fragment
M	source/blender/draw/intern/draw_manager.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index 61b5bcdb6a0..34ed1486550 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -455,6 +455,10 @@ class SCENE_PT_lanpr(SceneButtonsPanel, PropertyPanel, Panel):
         layout = self.layout
         scene = context.scene
         layout.prop(scene.lanpr, "enable_post_processing")
+        layout.prop(scene.lanpr, "depth_clamp")
+        layout.prop(scene.lanpr, "depth_strength")
+        layout.prop(scene.lanpr, "normal_clamp")
+        layout.prop(scene.lanpr, "normal_strength")
 
 
 class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index 3896da2e235..373ea06ed10 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -113,7 +113,7 @@ set(SRC
 	#engines/lanpr/NUL_TNS_Kernel.c
 	#engines/lanpr/NUL_Util.c
 	#engines/lanpr/NUL_TNS_SoftwareRender.c
-    #engines/lanpr/NUL_TNS_EdgeRendering.c
+    engines/lanpr/NUL_TNS_EdgeRendering.c
     #engines/lanpr/NUL_TNS_Mesh.c
 
 	DRW_engine.h
@@ -135,8 +135,8 @@ set(SRC
 	engines/eevee/eevee_private.h
 	engines/external/external_engine.h
 
-	#engines/lanpr/NUL_TNS.h
-	#engines/lanpr/NUL_Util.h
+	engines/lanpr/NUL_TNS.h
+	engines/lanpr/NUL_Util.h
 )
 
 if(WITH_CLAY_ENGINE)
@@ -229,6 +229,14 @@ data_to_c_simple(engines/workbench/shaders/workbench_data_lib.glsl SRC)
 data_to_c_simple(engines/workbench/shaders/workbench_object_overlap_lib.glsl SRC)
 data_to_c_simple(engines/workbench/shaders/workbench_world_light_lib.glsl SRC)
 
+data_to_c_simple(engines/lanpr/shaders/lanpr_atlas_preview.geometry SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_atlas_project_clip.fragment SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_atlas_project_passthrough.vertex SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_image_peel.fragment SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_line_connection.geometry SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_snake_edge.fragment SRC)
+data_to_c_simple(engines/lanpr/shaders/lanpr_snake_multichannel.fragment SRC)
+
 data_to_c_simple(modes/shaders/common_globals_lib.glsl SRC)
 data_to_c_simple(modes/shaders/common_view_lib.glsl SRC)
 data_to_c_simple(modes/shaders/common_fxaa_lib.glsl SRC)
diff --git a/source/blender/draw/engines/lanpr/NUL_TNS.h b/source/blender/draw/engines/lanpr/NUL_TNS.h
index 336f0143478..0509520a7bb 100644
--- a/source/blender/draw/engines/lanpr/NUL_TNS.h
+++ b/source/blender/draw/engines/lanpr/NUL_TNS.h
@@ -1,1088 +1,78 @@
 #pragma once
 
-#include "NUL4.h"
-#include "tinycthread.h"
-#include <float.h>
+#include "NUL_Util.h"
+
+#define LANPR_ENGINE "BLENDER_LANPR"
 
 #define TNS_PI 3.1415926535897932384626433832795
 #define deg(r) r/TNS_PI*180.0
 #define rad(d) d*TNS_PI/180.0
 
 
-//typedef real tnsMatrix33d[9];
-
-typedef float tnsMatrix44f[16];
-
-typedef real tnsMatrix44d[16];
-typedef real tnsVector2d[2];
-typedef real tnsVector3d[3];
-typedef real tnsVector4d[4];
-
-typedef int tnsVector2i[2];
-
-//typedef double tnsMatrix33d[9];
-//typedef double tnsMatrix44d[16];
-//
-typedef struct _tnsMatrixStackItem tnsMatrixStackItem;
-struct _tnsMatrixStackItem{
-	tnsMatrix44d view;
-	tnsMatrix44d model;
-	tnsMatrix44d projection;
-};
-typedef struct _tnsMatrixStack tnsMatrixStack;
-struct _tnsMatrixStack{
-	tnsMatrixStackItem* level;
-	int                 current_level;
-	int                 max_level;
-};
-
-typedef struct _tnsShader tnsShader;
-struct _tnsShader{
-	nListItem          Item;
-	int                vtShaderID;
-	int                fgShaderID;
-	int                glProgramID;
-
-	int                CustomID;
-
-	int                modelIndex;
-	int                projectionIndex;
-	int                viewIndex;
-	int                projectionInverseIndex;
-
-	int                vertexIndex;
-	int                normalIndex;
-	int                colorIndex;
-	int                uvIndex;
-	int                texture0Index;
-	int                texture1Index;
-	int                texture2Index;
-	int                texture3Index;
-	int                texture4Index;
-
-	int                uniform0Index;
-	int                uniform1Index;
-	int                uniform2Index;
-	int                uniform3Index;
-	int                uniform4Index;
-	int                uniform5Index;
-	int                uniform6Index;
-	int                uniform7Index;
-};
-typedef struct _tnsTexture tnsTexture;
-typedef struct _tnsCommand tnsCommand;
-struct _tnsCommand{
-	GLenum Mode;
-	short  Dimentions;// 2 or 3
-	char   UseVert;
-	char   UseColor;
-	char   UseNormal;
-	char   UseTexCoord;
-	char   UseIndex;
-	GLenum PolyMode;//0-solid 1-wire
-	GLenum Shade;//0-falt 1-smooth
-	GLfloat UniformColor[4];
-
-	short NumVert;
-	short NumIndex;
-	short VertBegin;
-	short VertEnd;//'END'is the next one after the last one.
-	short ColorBegin;
-	short ColorEnd;
-	short TexCoordBegin;
-	short TexCoordEnd;
-    short NormalBegin;
-	short NormalEnd;
-	GLushort IndexBegin;
-	GLushort IndexEnd;
-
-	tnsShader*  ReplaceShader;
-	tnsTexture* Texture0;
-	tnsTexture* Texture1;
-	tnsTexture* Texture2;
-};
-typedef struct _tnsMain tnsMain;
-typedef struct _tnsScene tnsScene;
-typedef struct _tnsWorld tnsWorld;
-struct _tnsWorld{
-	nHyperItem  Item;
-	nListHandle Scenes;
-	tnsScene*   ActiveScene;
-
-	//Basic Properties;
-	u16bit      TimeYear;
-	u8bit       TimeMonth;
-	u8bit       TimeDay;
-
-	nListHandle BezierCurves;
-	nListHandle  Meshes;
-};
-
-NEED_STRUCTURE(tnsLoopItem);
-NEED_STRUCTURE(tnsRenderLine);
-NEED_STRUCTURE(tnsRenderBuffer);
-
-STRUCTURE(tnsFilterKernel) {
-	int Size;
-	real* Kernel;
-};
-
-STRUCTURE(tnsTriangulateNode) {
-	char  Picked;
-	real Angle;//rad
-	tnsLoopItem* LoopItem;
-	tnsRenderLine* FowardRL;
-	tnsRenderLine* BackwardRL;
-};
-STRUCTURE(tnsTriangulateEdgeNode) {
-	tnsRenderLine* RL;
-
-};
-
-struct _tnsMain{
-	nHyperItem     Item;
-
-	tnsMatrixStack stack;
-
-	nListHandle    Shaders;
-	int            NextShaderIndex;
-	tnsShader*     CurrentShader;
-	tnsShader*     BindedShader;
-
-	//int            MatrixMode;
-	int            IsOffscreen;
-
-	char*          GLVersionStr;
-	char*          GLVendorStr;
-	char*          GLRendererStr;
-	char*          GLSLVersionStr;
-
-
-	tnsShader*     uiShader;
-	tnsShader*     stringShader;
-	tnsShader*     TextureShader;
-	tnsShader*     RectangleTextureShader;
-	tnsShader*     TextureMultiplyShader;
-	tnsShader*     MSTextureShader;
-	tnsShader*     MSATextureShader;
-	tnsShader*     TEST_MatcapShader;
-	tnsShader*     TransparentGridShader;
-	tnsShader*     SobelColorShader;
-	tnsShader*     SobelShader;
-	tnsShader*     ExtraBuffersShader;
-
-	tnsShader*     AtlasTransformShader;
-	tnsShader*     AtlasPreviewShader;
-
-	tnsShader*     ImagePeelShader;
-	tnsShader*     LineConnectionShader;
-
-	nListHandle    Textures;
-	tnsTexture*    PreviewTexture;
-
-	tnsFilterKernel EdgeGaussFilter;
-
-	GLenum         GlTextureSets;
-
-	GLenum         StateShadeMode;
-	GLenum         StatePolyMode;
-	tnsTexture*    StateTexture0;
-	tnsTexture*    StateTexture1;
-	tnsTexture*    StateTexture2;
-	tnsTexture*    Texture0Enabled;
-	tnsTexture*    Texture1Enabled;
-	tnsTexture*    Texture2Enabled;
-	tnsTexture*    Texture3Enabled;
-	tnsTexture*    Texture4Enabled;
-
-	GLfloat        StateColor[4];
-	
-	GLfloat        Vert[8192];
-	GLuint         VertBufObject;
-	short          NextVert;
-	
-	GLfloat        Color[8192];
-	GLuint         ColorBufObject;
-	short          NextColor;
-
-	GLfloat        Normal[8192];
-	GLuint         NormalBufObject;
-	short          NextNormal;
-
-	GLfloat        TexCoord[8192];
-	GLuint         TexCoordBufObject;
-	short          NextTexCoord;
-
-
-	GLushort       Index[1024];
-	GLuint         IndexBufObject;
-	GLushort       NextIndex;
-
-	tnsTriangulateNode SharedTN[4096];
-	u32bit             SharedTEBuf[4096];
-	tnsRenderLine*     SharedRLBuf[4096];
-
-	tnsCommand     DrawingCommand[128];
-	tnsCommand*    UsingCommand;
-
-	tnsWorld       World;
-
-	nListHandle      RenderBuffers;
-	tnsRenderBuffer* ActiveRenderBuffer;
-};
-
-typedef struct _tnsLineStripPoint tnsLineStripPoint;
-struct _tnsLineStripPoint {
-	nListItem  Item;
-	tnsVector3d P;
-};
-
-typedef struct _tnsLineStrip tnsLineStrip;
-struct _tnsLineStrip {
-	nListItem Item;
-	nListHandle Points;
-	int PointCount;
-};
-
-#define TNS_SNAKE_STRENGTH_LIMIT 30
-#define TNS_SNAKE_STEP_LENGTH 5
-#define TNS_SNAKE_STRENGTH_MARCHING_LIMIT 30
-
-#define TNS_SNAKE_EDGE_WIDTH 2
-#define TNS_SNAKE_FILTER_SIZE 6
-#define TNS_SNAKE_ANGLE_DEVIATE 0.5
-#define TNS_SNAKE_ANGLE_PRICISION 1
-#define TNS_SNAKE_STEP1 3
-#define TNS_SNAKE_STEP2 5
-
-
-typedef struct _tnsTextureSample tnsTextureSample;
-struct _tnsTextureSample {
-	nListItem Item;
-	u8bit     Sample;
-	int       X,Y;
-	real      Z;
-};
-
-typedef struct _tnsTexture tnsTexture;
-struct _tnsTexture{
-	nListItem Item;
-
-	int    IsRenderBuffer;
-
-	GLuint GLTexHandle;
-	GLuint GLTexBitsType;//like GL_RGBA
-	GLuint DataFormat;
-	GLuint DataType;
-	GLuint GLTexType;    //like GL_TEXTURE_2D
-	int    Width;
-	int    Height;
-
-	void*  DrawData;
-
-
-	int    RBWidth, RBHeight;
-	int    ElemSize;
-	void*  TextureReadBack;
-	void** SamplePtr;
-	nListHandle PendingSamples;
-	nListHandle ErasedSamples;
-
-	nListHandle LineStrips;
-};
-
-typedef struct _tnsOffscreen tnsOffscreen;
-struct _tnsOffscreen{
-	nListItem  Item;
-
-	tnsTexture* pColorTextures[16];
-	tnsTexture* pDepthTexture;
-	tnsTexture* pStencilTexture;
-
-	GLuint      FboHandle;
-
-	int         UseSecondary;
-};
-
-#define TNS_PROJECTION_MATRIX 1
-#define TNS_MODEL_MATRIX  2
-#define TNS_VIEW_MATRIX   3
-#define TNS_TEXTURE_MATRIX    4
-
-//==========================================================================[FT]
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include "ft2build.h"
-#include "freetype/ftglyph.h"
-#include "freetype/ftoutln.h"
-#include "freetype/fttrigon.h"
-
-
-extern char TNS_VERTEX_SHADER_SRC_UI_DEFAULT_130[];
-extern char TNS_FRAGMENT_SHADER_SRC_UI_DEFAULT_130[];
-extern char 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list