https://wiki.librecad.org/api.php?action=feedcontributions&user=Kartik+Kumar&feedformat=atomLibreCAD wiki - User contributions [en]2019-10-23T03:22:18ZUser contributionsMediaWiki 1.22.5https://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-28T13:52:35Z<p>Kartik Kumar: /* Week 14 */</p>
<hr />
<div><br />
=''' <pre style="color:green"> LibreCAD 3 OpenGL Rendering - GSoC 2019 </pre> '''=<br />
<br />
'''FINAL PR : click here --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229 OpenGL Rendering Implemented ] <br />
----<br />
'''LAST GSOC COMMIT --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
'''WORKING REPOSITORY --->''' :[https://github.com/sckorpio/LibreCAD_3 Working Repo]<br />
<br />
'''MY GITHUB --->''' :[https://github.com/sckorpio MyGitHub]<br />
----<br />
<br />
'''There are a lot of commits made, these are the ones with major milestones'''<br />
<br />
Viewport System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/a589542f72eaf64877b7ccdbdf55c3824d861e87 a589542]<br />
<br />
Coordinate System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/f0b27874ca8dd7a51b90a152dc3ab611a11797dc f0b2787] <br />
<br />
Context-Management :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/8af6bcccfb58ba8e4f4a579564694d9cf2d3bc4f 8af6bcc]<br />
<br />
Matrix transformations :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/da330e56b38c6b42733bedff5b526c6b3918642c da330e5]<br />
<br />
Paper-Background :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/5c28e68ec118839234671a47f59e266076bd2995 5c28e68]<br />
<br />
Caching-Mechanism :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4a402df6be2ab1cec7a7f2d1f8c1c4e749003b94 4a402df]<br />
<br />
Basic GL_Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/dec9c97214825929ab49a4fa6791282bf8ae8563 dec9c97]<br />
<br />
Gradient Entity:[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/fd9c35f3d3b6aad6f4835cd001260b1b9ac2156a fd9c35f]<br />
<br />
Gradient_Shader: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b75f17fb3b52c02f17e78c5ddd480e6c1ecd6736 b75f17f]<br />
<br />
Shader's Book: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/6b44b4051f171c9649ddbc094f20d9a2e2cc8902 6b44b40]<br />
<br />
Thicklines with mitter joints: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/c680b7e81c007d3d66f81eeedf266cf52f763c7d c680b7e]<br />
<br />
Line-Patterns :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/7a8d4682127642d6dccbb3a69f7f90e02dbf8ab1 7a8d468]<br />
<br />
Transparency :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/16d4d3178ea5a41a75a81fd97a4522ad69e52dfd 16d4d31]<br />
<br />
Font_Book :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/665a3a3a3312ad22be63a3ccc54266921c234d5f 665a3a3]<br />
<br />
Text Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/35d318d98fa72bf74d6a9149ae6b26983e306e41 35d318d] <br />
<br />
Text-Rendering :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b13289d3d548e9fd41e94bbe84e933fc0448a0d1 b13289d] <br />
<br />
Bezier Curves :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/15af822c93bb92370f1982834d0b97ce85529235 15af822] <br />
<br />
Arcs :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/470c15c9cb6f42c7bbef5e784956ea860b1a5f40 470c15c]<br />
<br />
Ellipse :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits<br />
<br />
==='''Week 14'''===<br />
----<br />
'''August 26th'''<br />
<br />
> Writing the final report for gsoc evaluation<br />
<br />
> Finished the Final Evaluation submission<br />
<br />
> Received feedback from mentor to use some superclass to remove some code duplication<br />
<br />
'''August 27th'''<br />
<br />
> Removed code duplication from renderer and cacher using new superclass manager<br />
<br />
> Removed code duplication from render and cacher opengl painters using new class openglpainter<br />
<br />
'''August 28th'''<br />
<br />
> Removed unnecessary font files<br />
<br />
> Set OpenGL major and minor versions<br />
<br />
> Finding and creating issues on lc3 main repo<br />
<br />
'''August 29th'''<br />
<br />
> <br />
<br />
'''August 30th'''<br />
<br />
><br />
<br />
'''August 31th'''<br />
<br />
> <br />
<br />
'''September 1st'''<br />
<br />
></div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-27T11:05:15Z<p>Kartik Kumar: /* Week 13 */</p>
<hr />
<div><br />
=''' <pre style="color:green"> LibreCAD 3 OpenGL Rendering - GSoC 2019 </pre> '''=<br />
<br />
'''FINAL PR : click here --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229 OpenGL Rendering Implemented ] <br />
----<br />
'''LAST GSOC COMMIT --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
'''WORKING REPOSITORY --->''' :[https://github.com/sckorpio/LibreCAD_3 Working Repo]<br />
<br />
'''MY GITHUB --->''' :[https://github.com/sckorpio MyGitHub]<br />
----<br />
<br />
'''There are a lot of commits made, these are the ones with major milestones'''<br />
<br />
Viewport System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/a589542f72eaf64877b7ccdbdf55c3824d861e87 a589542]<br />
<br />
Coordinate System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/f0b27874ca8dd7a51b90a152dc3ab611a11797dc f0b2787] <br />
<br />
Context-Management :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/8af6bcccfb58ba8e4f4a579564694d9cf2d3bc4f 8af6bcc]<br />
<br />
Matrix transformations :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/da330e56b38c6b42733bedff5b526c6b3918642c da330e5]<br />
<br />
Paper-Background :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/5c28e68ec118839234671a47f59e266076bd2995 5c28e68]<br />
<br />
Caching-Mechanism :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4a402df6be2ab1cec7a7f2d1f8c1c4e749003b94 4a402df]<br />
<br />
Basic GL_Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/dec9c97214825929ab49a4fa6791282bf8ae8563 dec9c97]<br />
<br />
Gradient Entity:[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/fd9c35f3d3b6aad6f4835cd001260b1b9ac2156a fd9c35f]<br />
<br />
Gradient_Shader: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b75f17fb3b52c02f17e78c5ddd480e6c1ecd6736 b75f17f]<br />
<br />
Shader's Book: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/6b44b4051f171c9649ddbc094f20d9a2e2cc8902 6b44b40]<br />
<br />
Thicklines with mitter joints: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/c680b7e81c007d3d66f81eeedf266cf52f763c7d c680b7e]<br />
<br />
Line-Patterns :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/7a8d4682127642d6dccbb3a69f7f90e02dbf8ab1 7a8d468]<br />
<br />
Transparency :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/16d4d3178ea5a41a75a81fd97a4522ad69e52dfd 16d4d31]<br />
<br />
Font_Book :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/665a3a3a3312ad22be63a3ccc54266921c234d5f 665a3a3]<br />
<br />
Text Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/35d318d98fa72bf74d6a9149ae6b26983e306e41 35d318d] <br />
<br />
Text-Rendering :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b13289d3d548e9fd41e94bbe84e933fc0448a0d1 b13289d] <br />
<br />
Bezier Curves :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/15af822c93bb92370f1982834d0b97ce85529235 15af822] <br />
<br />
Arcs :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/470c15c9cb6f42c7bbef5e784956ea860b1a5f40 470c15c]<br />
<br />
Ellipse :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits<br />
<br />
==='''Week 14'''===<br />
----<br />
'''August 26th'''<br />
<br />
> Writing the final report for gsoc evaluation<br />
<br />
> Finished the Final Evaluation submission<br />
<br />
> Received feedback from mentor to use some superclass to remove some code duplication<br />
<br />
'''August 27th'''<br />
<br />
> Removed code duplication from renderer and cacher using new superclass manager<br />
<br />
> Removed code duplication from render and cacher opengl painters using new class openglpainter<br />
<br />
'''August 28th'''<br />
<br />
><br />
<br />
'''August 29th'''<br />
<br />
> <br />
<br />
'''August 30th'''<br />
<br />
><br />
<br />
'''August 31th'''<br />
<br />
> <br />
<br />
'''September 1st'''<br />
<br />
></div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T13:23:53Z<p>Kartik Kumar: /* CODE */</p>
<hr />
<div><br />
=''' <pre style="color:green"> LibreCAD 3 OpenGL Rendering - GSoC 2019 </pre> '''=<br />
<br />
'''FINAL PR : click here --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229 OpenGL Rendering Implemented ] <br />
----<br />
'''LAST GSOC COMMIT --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
'''WORKING REPOSITORY --->''' :[https://github.com/sckorpio/LibreCAD_3 Working Repo]<br />
<br />
'''MY GITHUB --->''' :[https://github.com/sckorpio MyGitHub]<br />
----<br />
<br />
'''There are a lot of commits made, these are the ones with major milestones'''<br />
<br />
Viewport System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/a589542f72eaf64877b7ccdbdf55c3824d861e87 a589542]<br />
<br />
Coordinate System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/f0b27874ca8dd7a51b90a152dc3ab611a11797dc f0b2787] <br />
<br />
Context-Management :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/8af6bcccfb58ba8e4f4a579564694d9cf2d3bc4f 8af6bcc]<br />
<br />
Matrix transformations :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/da330e56b38c6b42733bedff5b526c6b3918642c da330e5]<br />
<br />
Paper-Background :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/5c28e68ec118839234671a47f59e266076bd2995 5c28e68]<br />
<br />
Caching-Mechanism :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4a402df6be2ab1cec7a7f2d1f8c1c4e749003b94 4a402df]<br />
<br />
Basic GL_Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/dec9c97214825929ab49a4fa6791282bf8ae8563 dec9c97]<br />
<br />
Gradient Entity:[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/fd9c35f3d3b6aad6f4835cd001260b1b9ac2156a fd9c35f]<br />
<br />
Gradient_Shader: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b75f17fb3b52c02f17e78c5ddd480e6c1ecd6736 b75f17f]<br />
<br />
Shader's Book: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/6b44b4051f171c9649ddbc094f20d9a2e2cc8902 6b44b40]<br />
<br />
Thicklines with mitter joints: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/c680b7e81c007d3d66f81eeedf266cf52f763c7d c680b7e]<br />
<br />
Line-Patterns :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/7a8d4682127642d6dccbb3a69f7f90e02dbf8ab1 7a8d468]<br />
<br />
Transparency :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/16d4d3178ea5a41a75a81fd97a4522ad69e52dfd 16d4d31]<br />
<br />
Font_Book :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/665a3a3a3312ad22be63a3ccc54266921c234d5f 665a3a3]<br />
<br />
Text Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/35d318d98fa72bf74d6a9149ae6b26983e306e41 35d318d] <br />
<br />
Text-Rendering :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b13289d3d548e9fd41e94bbe84e933fc0448a0d1 b13289d] <br />
<br />
Bezier Curves :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/15af822c93bb92370f1982834d0b97ce85529235 15af822] <br />
<br />
Arcs :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/470c15c9cb6f42c7bbef5e784956ea860b1a5f40 470c15c]<br />
<br />
Ellipse :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T12:17:08Z<p>Kartik Kumar: /* MAJOR MILESTONES */</p>
<hr />
<div><br />
=''' <pre style="color:green"> CODE </pre> '''=<br />
<br />
'''FINAL PR : click here --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229 OpenGL Rendering Implemented ] <br />
----<br />
'''LAST GSOC COMMIT --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
'''WORKING REPOSITORY --->''' :[https://github.com/sckorpio/LibreCAD_3 Working Repo]<br />
<br />
'''MY GITHUB --->''' :[https://github.com/sckorpio MyGitHub]<br />
----<br />
<br />
'''There are a lot of commits made, these are the ones with major milestones'''<br />
<br />
Viewport System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/a589542f72eaf64877b7ccdbdf55c3824d861e87 a589542]<br />
<br />
Coordinate System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/f0b27874ca8dd7a51b90a152dc3ab611a11797dc f0b2787] <br />
<br />
Context-Management :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/8af6bcccfb58ba8e4f4a579564694d9cf2d3bc4f 8af6bcc]<br />
<br />
Matrix transformations :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/da330e56b38c6b42733bedff5b526c6b3918642c da330e5]<br />
<br />
Paper-Background :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/5c28e68ec118839234671a47f59e266076bd2995 5c28e68]<br />
<br />
Caching-Mechanism :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4a402df6be2ab1cec7a7f2d1f8c1c4e749003b94 4a402df]<br />
<br />
Basic GL_Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/dec9c97214825929ab49a4fa6791282bf8ae8563 dec9c97]<br />
<br />
Gradient Entity:[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/fd9c35f3d3b6aad6f4835cd001260b1b9ac2156a fd9c35f]<br />
<br />
Gradient_Shader: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b75f17fb3b52c02f17e78c5ddd480e6c1ecd6736 b75f17f]<br />
<br />
Shader's Book: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/6b44b4051f171c9649ddbc094f20d9a2e2cc8902 6b44b40]<br />
<br />
Thicklines with mitter joints: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/c680b7e81c007d3d66f81eeedf266cf52f763c7d c680b7e]<br />
<br />
Line-Patterns :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/7a8d4682127642d6dccbb3a69f7f90e02dbf8ab1 7a8d468]<br />
<br />
Transparency :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/16d4d3178ea5a41a75a81fd97a4522ad69e52dfd 16d4d31]<br />
<br />
Font_Book :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/665a3a3a3312ad22be63a3ccc54266921c234d5f 665a3a3]<br />
<br />
Text Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/35d318d98fa72bf74d6a9149ae6b26983e306e41 35d318d] <br />
<br />
Text-Rendering :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b13289d3d548e9fd41e94bbe84e933fc0448a0d1 b13289d] <br />
<br />
Bezier Curves :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/15af822c93bb92370f1982834d0b97ce85529235 15af822] <br />
<br />
Arcs :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/470c15c9cb6f42c7bbef5e784956ea860b1a5f40 470c15c]<br />
<br />
Ellipse :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T12:16:36Z<p>Kartik Kumar: /* MAJOR MILESTONES */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
'''FINAL PR : click here --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229 OpenGL Rendering Implemented ] <br />
----<br />
'''LAST GSOC COMMIT --->''' :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
'''WORKING REPOSITORY --->''' :[https://github.com/sckorpio/LibreCAD_3 Working Repo]<br />
<br />
'''MY GITHUB --->''' :[https://github.com/sckorpio MyGitHub]<br />
----<br />
<br />
'''There are a lot of commits made, these are the ones with major milestones'''<br />
<br />
Viewport System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/a589542f72eaf64877b7ccdbdf55c3824d861e87 a589542]<br />
<br />
Coordinate System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/f0b27874ca8dd7a51b90a152dc3ab611a11797dc f0b2787] <br />
<br />
Context-Management :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/8af6bcccfb58ba8e4f4a579564694d9cf2d3bc4f 8af6bcc]<br />
<br />
Matrix transformations :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/da330e56b38c6b42733bedff5b526c6b3918642c da330e5]<br />
<br />
Paper-Background :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/5c28e68ec118839234671a47f59e266076bd2995 5c28e68]<br />
<br />
Caching-Mechanism :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4a402df6be2ab1cec7a7f2d1f8c1c4e749003b94 4a402df]<br />
<br />
Basic GL_Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/dec9c97214825929ab49a4fa6791282bf8ae8563 dec9c97]<br />
<br />
Gradient Entity:[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/fd9c35f3d3b6aad6f4835cd001260b1b9ac2156a fd9c35f]<br />
<br />
Gradient_Shader: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b75f17fb3b52c02f17e78c5ddd480e6c1ecd6736 b75f17f]<br />
<br />
Shader's Book: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/6b44b4051f171c9649ddbc094f20d9a2e2cc8902 6b44b40]<br />
<br />
Thicklines with mitter joints: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/c680b7e81c007d3d66f81eeedf266cf52f763c7d c680b7e]<br />
<br />
Line-Patterns :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/7a8d4682127642d6dccbb3a69f7f90e02dbf8ab1 7a8d468]<br />
<br />
Transparency :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/16d4d3178ea5a41a75a81fd97a4522ad69e52dfd 16d4d31]<br />
<br />
Font_Book :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/665a3a3a3312ad22be63a3ccc54266921c234d5f 665a3a3]<br />
<br />
Text Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/35d318d98fa72bf74d6a9149ae6b26983e306e41 35d318d] <br />
<br />
Text-Rendering :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b13289d3d548e9fd41e94bbe84e933fc0448a0d1 b13289d] <br />
<br />
Bezier Curves :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/15af822c93bb92370f1982834d0b97ce85529235 15af822] <br />
<br />
Arcs :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/470c15c9cb6f42c7bbef5e784956ea860b1a5f40 470c15c]<br />
<br />
Ellipse :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T11:17:15Z<p>Kartik Kumar: /* MAJOR MILESTONES */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
Viewport System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/a589542f72eaf64877b7ccdbdf55c3824d861e87 a589542]<br />
<br />
Coordinate System :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/f0b27874ca8dd7a51b90a152dc3ab611a11797dc f0b2787] <br />
<br />
Context-Management :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/8af6bcccfb58ba8e4f4a579564694d9cf2d3bc4f 8af6bcc]<br />
<br />
Matrix transformations :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/da330e56b38c6b42733bedff5b526c6b3918642c da330e5]<br />
<br />
Paper-Background :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/5c28e68ec118839234671a47f59e266076bd2995 5c28e68]<br />
<br />
Caching-Mechanism :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4a402df6be2ab1cec7a7f2d1f8c1c4e749003b94 4a402df]<br />
<br />
Basic GL_Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/dec9c97214825929ab49a4fa6791282bf8ae8563 dec9c97]<br />
<br />
Gradient Entity:[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/fd9c35f3d3b6aad6f4835cd001260b1b9ac2156a fd9c35f]<br />
<br />
Gradient_Shader: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b75f17fb3b52c02f17e78c5ddd480e6c1ecd6736 b75f17f]<br />
<br />
Shader's Book: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/6b44b4051f171c9649ddbc094f20d9a2e2cc8902 6b44b40]<br />
<br />
Thicklines with mitter joints: [https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/c680b7e81c007d3d66f81eeedf266cf52f763c7d c680b7e]<br />
<br />
Line-Patterns :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/7a8d4682127642d6dccbb3a69f7f90e02dbf8ab1 7a8d468]<br />
<br />
Transparency :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/16d4d3178ea5a41a75a81fd97a4522ad69e52dfd 16d4d31]<br />
<br />
Font_Book :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/665a3a3a3312ad22be63a3ccc54266921c234d5f 665a3a3]<br />
<br />
Text Entity :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/35d318d98fa72bf74d6a9149ae6b26983e306e41 35d318d] <br />
<br />
Text-Rendering :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/b13289d3d548e9fd41e94bbe84e933fc0448a0d1 b13289d] <br />
<br />
Bezier Curves :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/15af822c93bb92370f1982834d0b97ce85529235 15af822] <br />
<br />
Arcs :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/470c15c9cb6f42c7bbef5e784956ea860b1a5f40 470c15c]<br />
<br />
Ellipse :[https://github.com/LibreCAD/LibreCAD_3/pull/229/commits/4b43e5fbf3cec704711dae233e8075a2222360a7 4b43e5f]<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:42:37Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: orange"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:41:45Z<p>Kartik Kumar: /* Coding Period Phase 1 */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color:orange"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:41:19Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:orange"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:40:33Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:gold"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:38:53Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:blue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:38:32Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:cyan"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:38:06Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:darkyellow"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:37:48Z<p>Kartik Kumar: /* MAJOR MILESTONES */</p>
<hr />
<div><br />
=''' <pre style="color:green"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:skyblue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:37:32Z<p>Kartik Kumar: /* MAJOR MILESTONES */</p>
<hr />
<div><br />
=''' <pre style="color:lightgreen"> MAJOR MILESTONES </pre> '''=<br />
<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:skyblue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:37:12Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:skyblue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:36:57Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:lightblue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:36:41Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color:light blue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:30:41Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color: blue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: blue"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: blue"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:29:36Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color: blue"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:28:34Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color: yellow"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:28:21Z<p>Kartik Kumar: /* Community Bonding Period (May 6th - May 27th) */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color: dark yellow"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:27:38Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color: dark grey"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:26:47Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: green"> MAJOR MILESTONES </pre> '''=<br />
=''' <pre style="color: green"> PROJECT TIMELINE </pre> '''=<br />
==''' <pre style="color: grey"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:22:04Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''=<br />
<br />
==''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:20:40Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''=<br />
<br />
==''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==''' <pre style="color: green"> Coding Period Phase 1 </pre> '''==<br />
==='''Week 1'''===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:19:43Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''=<br />
<br />
==''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
=== ''' <pre style="color: green"> Coding Period Phase 1 </pre> '''===<br />
===='''Week 1'''====<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:18:10Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''=<br />
<br />
==''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 1 </pre> ''' ==<br />
=== '''Week 1''' ===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
==='''Week 5'''===<br />
----<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:17:09Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''=<br />
<br />
==''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 1 </pre> ''' ==<br />
=== '''Week 1''' ===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 3''' ===<br />
----<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
=== '''Week 4''' ===<br />
----<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 </pre> ''' ==<br />
<br />
=== '''Week 6''' ===<br />
----<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
=== '''Week 7''' ===<br />
----<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
==='''Week 8'''===<br />
----<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
==='''Week 9'''===<br />
----<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
==='''Week 10'''===<br />
----<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
==='''Week 11'''===<br />
----<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
==='''Week 12'''===<br />
----<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
==='''Week 13'''===<br />
----<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:12:15Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
=''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''=<br />
<br />
==''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''==<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 1 </pre> ''' ==<br />
=== '''Week 1''' ===<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
==='''Week 2'''===<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 3''' ==<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 4''' ==<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 (June 29th - July 26th) </pre> ''' ==<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== '''Week 6''' ==<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
== '''Week 7''' ==<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 8''' ==<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
== '''Week 9''' ==<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== '''Week 10''' ==<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
== '''Week 11''' ==<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
== '''Week 12''' ==<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
== '''Week 13''' ==<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:10:20Z<p>Kartik Kumar: /* Coding Period Phase 1 (May 27th - June 28th) */</p>
<hr />
<div><br />
==''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''==<br />
<br />
===''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''===<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
=== ''' <pre style="color: green"> Coding Period Phase 1 </pre> ''' ===<br />
==== '''Week 1''' ====<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
===='''Week 2'''====<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 3''' ==<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 4''' ==<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 (June 29th - July 26th) </pre> ''' ==<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== '''Week 6''' ==<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
== '''Week 7''' ==<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 8''' ==<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
== '''Week 9''' ==<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== '''Week 10''' ==<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
== '''Week 11''' ==<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
== '''Week 12''' ==<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
== '''Week 13''' ==<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:09:30Z<p>Kartik Kumar: /* Week 2 */</p>
<hr />
<div><br />
==''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''==<br />
<br />
===''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''===<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
=== ''' <pre style="color: green"> Coding Period Phase 1 (May 27th - June 28th) </pre> ''' ===<br />
==== '''Week 1''' ====<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
===='''Week 2'''====<br />
----<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 3''' ==<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 4''' ==<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 (June 29th - July 26th) </pre> ''' ==<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== '''Week 6''' ==<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
== '''Week 7''' ==<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 8''' ==<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
== '''Week 9''' ==<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== '''Week 10''' ==<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
== '''Week 11''' ==<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
== '''Week 12''' ==<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
== '''Week 13''' ==<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:08:18Z<p>Kartik Kumar: /* Week 1 */</p>
<hr />
<div><br />
==''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''==<br />
<br />
===''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''===<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
=== ''' <pre style="color: green"> Coding Period Phase 1 (May 27th - June 28th) </pre> ''' ===<br />
==== '''Week 1''' ====<br />
----<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
== '''Week 2'''==<br />
<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 3''' ==<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 4''' ==<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 (June 29th - July 26th) </pre> ''' ==<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== '''Week 6''' ==<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
== '''Week 7''' ==<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 8''' ==<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
== '''Week 9''' ==<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== '''Week 10''' ==<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
== '''Week 11''' ==<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
== '''Week 12''' ==<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
== '''Week 13''' ==<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T10:04:18Z<p>Kartik Kumar: /* PROJECT TIMELINE */</p>
<hr />
<div><br />
==''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''==<br />
<br />
===''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''===<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
=== ''' <pre style="color: green"> Coding Period Phase 1 (May 27th - June 28th) </pre> ''' ===<br />
==== '''Week 1''' ====<br />
---<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
== '''Week 2'''==<br />
<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 3''' ==<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 4''' ==<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 (June 29th - July 26th) </pre> ''' ==<br />
<br />
'''June 29th'''<br />
<br />
> Discussed more with Mentor to make the entities more abstracted and robust<br />
<br />
> Avoiding the conditional statements and now implementing the draw logic of different entity in their respective classes<br />
<br />
'''June 30th'''<br />
<br />
> First time successfully separated the draw code , working OK<br />
<br />
> Now working on making a Base class of entity which others will implement<br />
<br />
== '''Week 6''' ==<br />
'''July 1st'''<br />
<br />
> Completed the Gradient rendering ( Gradient Entity , functions etc )<br />
<br />
> Implemented the Linear_Gradient calculation function using vector geometry math<br />
<br />
> Finally got the correct gradient background and paper background result all working OK<br />
<br />
'''July 2nd'''<br />
<br />
> Found out some issues with the coordinate system <br />
<br />
> Solved the issue , Finally the coordinate system is corrected , rendering correct , gradient correct , DXF files opening correctly<br />
<br />
'''July 3rd'''<br />
<br />
> Started learning about the shader based linepattern, dashes<br />
<br />
'''July 4th'''<br />
<br />
> Searched some articles on how to render linepattern and dashes<br />
<br />
> Learning how to design the fragment shader to render dashes<br />
<br />
'''July 5th'''<br />
<br />
> Implemented few simple linepattern ( consist of dash and gap only ) roughly in seperate codes<br />
<br />
> Debugging how the LC3 stores the line pattern in vector<br />
<br />
'''July 6th'''<br />
<br />
> BREAK<br />
<br />
'''July 7th'''<br />
<br />
> Discussion with mentor on how to implement the linepattern based on the research work done yet<br />
<br />
> Got a bug reported by mentor , discussing with him and trying to debug.<br />
<br />
== '''Week 7''' ==<br />
'''July 8th'''<br />
<br />
> Still finding Some concrete method for line pattern which is optimal and feasible ( It should have less CPU computations and support caching also )<br />
<br />
> Trying Some GLSL Shaders to get results<br />
<br />
'''July 9th'''<br />
<br />
> Found out a mathematical way by which CPU computation is required only once , trying to implement this method with GLSL<br />
<br />
> First Time successfully rendered correct line patterns , Now this looks integrable with LC3 and could support caching also <br />
<br />
'''July 10th'''<br />
<br />
> Working on GLSL shaders to render more line patterns<br />
<br />
'''July 11th'''<br />
<br />
> Trying to save the line pattern data as an array of ratios representing dash and gap<br />
<br />
> The pattern with even elements is to repeated directly while the one with odd elements gets flipped every time.<br />
<br />
'''July 12th'''<br />
<br />
> made new GLSL Shaders to render thick , continous , seamless dashed lines with miter at edges<br />
<br />
> Tessellate line with 2 triangles using Geometry Shader and then rendering or discarding fragments according to dash/gap in fragment shader<br />
<br />
> Now have basic , gradient , thickline , dashed thickline etc as new shaders<br />
<br />
> Next is to start with revamping code which can send data in correct format accordingly to shader type<br />
<br />
'''July 13th'''<br />
<br />
> made new commit , tried to solve the gradient background issue<br />
<br />
> Gradient Repo seems working all ok, Current repo work fine on different machines too<br />
<br />
'''July 14th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 8''' ==<br />
'''July 15th'''<br />
<br />
> Finding ways to integrate the thick line and line pattern shaders with codebase<br />
<br />
'''July 16th'''<br />
<br />
> finalize the shaders to be used with librecad opengl module for linepatterns<br />
<br />
> Reviewing how much and where the changes would be required for integrating the shaders<br />
<br />
'''July 17th'''<br />
<br />
> Got reported by mentor about the OpenGL Debugger with Qt<br />
<br />
> Found a number of gl calls which are depreciated and replaced then with latest compatible calls<br />
<br />
> Still there is the issue of gradient background freeing memory<br />
<br />
'''July 18th'''<br />
<br />
> On AMD GPUs the repo works perfect , now checking on NVIDIA GPU<br />
<br />
> Got the bug on NVIDIA systems, trying to seperate glDelete*** calls from destructors of CPU side objects<br />
<br />
> Fixed the bug and got it reviewed by the mentor, Finally its done!!!<br />
<br />
'''July 19th'''<br />
<br />
> Back to work on Dash-Gap and linepatterns<br />
<br />
> Add uniform arrays in shader files to pass variable dash-gap data<br />
<br />
> Updated shader class to access the dash-gap uniforms<br />
<br />
'''July 20th'''<br />
<br />
> Raw testing the dash pattern shader with capped joints lines , working Ok <br />
<br />
'''July 21st'''<br />
<br />
> Also checked the Mitter Joints line / linepattern shader<br />
<br />
> Discussing with mentor regarding the selection , integration of which type(CAP or MITTER) to be used<br />
<br />
== '''Week 9''' ==<br />
'''July 22nd'''<br />
<br />
> Also trying to find ways to integrate the MITTER joints thicklines/linepattern shaders<br />
<br />
> Getting more complicated with GL_LINE_ADJACENCY , need to change functions to manipulate index data in Renderer class<br />
<br />
'''July 23rd'''<br />
<br />
> Making algorithms which can support jumping of pen also <br />
<br />
> Multiple shapes within one VBO and which could still support GL_LINE_STRIP_ADJACENCY<br />
<br />
'''July 24th'''<br />
<br />
> Created a algorithm which can fulfill all the need and which is performance and memory efficient<br />
<br />
> Coding it roughly in separate codes and testing, working OK <br />
<br />
'''July 25th'''<br />
<br />
> Now time is to Integrate this method and revamp the codebase of LC3<br />
<br />
> Finally revamped the Code!!! <br />
<br />
> Now it can support jumping pen , thick lines, linepatterns all working OK<br />
<br />
'''July 26th'''<br />
<br />
> Now working on shader class so that it can support geometry shader , parse it and compile it ( if present )<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 3 (July 27th - Aug 19th) </pre> ''' ==<br />
<br />
'''July 27th'''<br />
<br />
> Updated Shader class<br />
<br />
> Now its parsing and compiling Shader files having geometry shader also<br />
<br />
'''July 28th'''<br />
<br />
> Working on how and when to render Thicklines <br />
<br />
> Making/Updating Functions to apply entity properties and pick the correct shader required<br />
<br />
> Joined the thickline shader to work<br />
<br />
> Finally rendered Thicklines having MITTER joints, all working OK<br />
<br />
== '''Week 10''' ==<br />
'''July 29th'''<br />
<br />
> Now Starting with modifying codebase to render dash patterns<br />
<br />
> Modified vertex data to store length of path<br />
<br />
> Added new attributes in shape_entity to have properties of dashed patterns<br />
<br />
'''July 30th'''<br />
<br />
> Added new shader to render dashed/thick lines<br />
<br />
> Rough testing the shader and clearing errors.<br />
<br />
'''July 31st'''<br />
<br />
> Finally Rendered dashed lines with fixed dash pattern right now<br />
<br />
> Reported the mentor about implementation and asking feedback<br />
<br />
> Now working on passing variable dash pattern data to shader via Renderer<br />
<br />
'''August 1st'''<br />
<br />
> Working on variable dashed lines pattern ( create from UI )<br />
<br />
> Joined the dashed data coming from kernel to shaders via document canvas and renderer<br />
<br />
> Finally finished rendering line patterns<br />
<br />
'''August 2nd'''<br />
<br />
> Working on transparency <br />
<br />
> Enabled transparency and fixed the vertex data during fill<br />
<br />
> transparency working OK<br />
<br />
> fixed a minor segmentation fault because of a garbage value of uninitialized dash_size variable on launch of LC3<br />
<br />
'''August 3rd'''<br />
<br />
> Reported mentor about the work finished regarding linepatterns<br />
<br />
> Got Feedback correct!!! All working Ok<br />
<br />
'''August 4th'''<br />
<br />
> Finding way to make the thick lines render with magnified or non magnified width while zooming keeping the same codebase<br />
<br />
> Changed the draw() code of shape entity to support the magnified width property<br />
<br />
== '''Week 11''' ==<br />
'''August 5th'''<br />
<br />
> Started work on Text Rendering module<br />
<br />
> Preparing the layout of different classes need to abstract text rendering property<br />
<br />
'''August 6th'''<br />
<br />
> Implemented Text_entity Class to support rendering and caching Text rendering <br />
<br />
> Made a Writer class to use the Freetype Library and built and cache the character glyphs textures<br />
<br />
'''August 7th'''<br />
<br />
> Making changes in codebase to support Texture rendering<br />
<br />
> Finding errors while using Freetype library with Qt<br />
<br />
> Updated and Merged the Main Librecad_3 repo in the current repo <br />
<br />
'''August 8th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 9th'''<br />
<br />
> UNABLE TO WORK DUE TO ACADEMIC PURPOSE :(<br />
<br />
'''August 10th'''<br />
<br />
> Again started with making new Gl_Font and Writer classes<br />
<br />
> This Time making it more abstracted so that it can support multiple fonts in the same document<br />
<br />
'''August 11th'''<br />
<br />
> Finally integrated the Freetype Library correctly in lc3<br />
<br />
> Implemented GL_font Class and tried rendering some text directly, Working Correct<br />
<br />
== '''Week 12''' ==<br />
'''August 12th'''<br />
<br />
> Working on Font_Book to cache multiple GL_Font objects ( discarding Writer class the text render method made itself in GL_Font )<br />
<br />
> Created a Default Font to be used when a specific font is missing<br />
<br />
> Implemented Font_Book , working OK<br />
<br />
'''August 13th'''<br />
<br />
> Started Working on Text_Entity<br />
<br />
> Joined the Text_Entity with the GL_Font and Font_Book<br />
<br />
> Tested rendering Font with Cursor , Dimensions and Entities with their model matrix, Working OK<br />
<br />
'''August 14th'''<br />
<br />
> Now Started Joining the outermost calls of painter to the Renderer/Cacher for Text Rendering<br />
<br />
> Finished abstracting Text Rendering Calls , Checked text rendering with Cursor and Dimensions etc<br />
<br />
> Finally Finished Text Rendering, Working all OK<br />
<br />
'''August 15th'''<br />
<br />
> Debugging for the Bezier curves , Quadratic , cubic curves<br />
<br />
> Got Feedback from mentor regarding Text Rendering<br />
<br />
> Writing blog for GSoC Phase 2 experience<br />
<br />
'''August 16th'''<br />
<br />
> Implementing Bezier curves<br />
<br />
> Solving some issues related to vertex data<br />
<br />
'''August 17th'''<br />
<br />
> Finished Bezier curves , quadratic and cubic<br />
<br />
> Starting implementing Ellipse<br />
<br />
'''August 18th'''<br />
<br />
> Found some issue with editing/rotating ellipse from UI , reported to mentor [ TODO: solve later ]<br />
<br />
> Trying to implement ellipse using matrix transformation and arc method, but it is disturbing CTM and line patterns<br />
<br />
> Implemented Ellipse using Parametric Equation after converting the angle limits to eccentric angles<br />
<br />
> Finally Ellipse Implemented , Rendering all OK<br />
<br />
== '''Week 13''' ==<br />
'''August 19th'''<br />
<br />
> Working on cmake to create cpp file which will save the absolute paths of RESOURCES during compilation<br />
<br />
> Accesing RESOURCES(SHADER and FONT) paths from that file and generate the resources at runtime<br />
<br />
> Now No need to put shaders/font files absolute paths manually, All Working OK <br />
<br />
'''August 20th'''<br />
<br />
> Cleaning Code and syntax<br />
<br />
> Got feedback from mentor to slightly change the approach of Settings to save Resources absolute path at compilation<br />
<br />
'''August 21st'''<br />
<br />
> Implemented the resources path settings using ModuleSettings <br />
<br />
> Cleaned codebase according to LC3 syntax rules<br />
<br />
> Removed the unused/dead codes<br />
<br />
> Removed all the Debug calls<br />
<br />
> Finally cleaned the code and testing , waiting for mentor's feedback<br />
<br />
'''August 22nd'''<br />
<br />
> Found some little issues in rendering module <br />
<br />
> Implemented Extended character rendering<br />
<br />
> Implemented Text Extends<br />
<br />
> Fixed Arc rendering , made it perfect<br />
<br />
> Finally Fixed all issues , Now rendering module has no issue<br />
<br />
'''August 23rd'''<br />
<br />
> Got Feedback from mentor regarding cleaning code<br />
<br />
> Reset Unnecessarily Changed Files <br />
<br />
> Changed folder names from UPPERCASE to lowercases<br />
<br />
'''August 24th'''<br />
<br />
> Trying to get build successfully on Travis CI , ( getting issues with QOpenglWidget)<br />
<br />
> Discussing with mentor about the issue, we are still trying to fix it<br />
<br />
> Got update from mentor with travis updated , Made progress build successful , but unittest failing<br />
<br />
> Fixed some code in rendering module , Now Travis build and unittest all sucessful<br />
<br />
> Now Working on CodeFactor issues , Fixed all codefactor issues<br />
<br />
> All Checks passed for merging<br />
<br />
'''August 25th'''<br />
<br />
> Testing rendering and finding any issue<br />
<br />
> Fixed a minor issue with ellipse , now rendering is perfect according to rendering tests<br />
<br />
> Editing Dev-Log , adding important links to major commits</div>Kartik Kumarhttps://wiki.librecad.org/index.php?title=GSoC_2019_Dev_LogGSoC 2019 Dev Log2019-08-25T09:58:28Z<p>Kartik Kumar: /* Coding Period Phase 1 (May 27th - June 28th) */</p>
<hr />
<div><br />
==''' <pre style="color: blue"> PROJECT TIMELINE </pre> '''==<br />
<br />
====''' <pre style="color: green"> Community Bonding Period (May 6th - May 27th) </pre> '''====<br />
<br />
> During Community Bonding Period i continued doing more research work for the LibreCAD OpenGL rendering project.<br />
<br />
> Linked a partial implemented OpenGL painter with the LibreCAD 3 which uses BufferObjects for rendering<br />
<br />
> Implemented basic facilities like pan, zoom<br />
<br />
> I started with finding the connections of rendering functions of drawables,drawentities etc.<br />
<br />
> Implement and connect the drawables like grid,cursor, origin pointer etc.<br />
<br />
> Found connection of tempentities , drawentities <br />
<br />
> Tried and check ways of Text Rendering with OpenGL painter( basic ttf type / MSDF type )<br />
<br />
> Found place for the caching the saved entities.<br />
<br />
> Implemented few more functions in opengl painter (analogous to Cairo) which does Matrix/Vector/Coordinate manipulations(manually with GLM)<br />
<br />
> Deciding the basic complete layout of OpenGL painter and found possible ways of complete implementation : https://github.com/sckorpio/LibreCAD_3<br />
<br />
> I created blog for the development log on LibreCAD blog : https://blog.librecad.org/tag/google-summer-of-code-gsoc-2019/<br />
<br />
''' TODO:'''<br />
<br />
> Finalize and implement basic gl_entity class which could hold all type of possible entities and render them<br />
<br />
> Create a gl_pack class which could hold a number of gl_entities to cache and render complex entities (like dimensions)<br />
<br />
> Decide which text rendering should be used (basic ttf or MSDF or both..)<br />
<br />
> little research work left on gradient rendering and line patterns and continuing work to complete the painter implementation<br />
<br />
==== ''' <pre style="color: green"> Coding Period Phase 1 (May 27th - June 28th) </pre> ''' ====<br />
===== '''Week 1''' =====<br />
'''May 27th'''<br />
<br />
> I started with reviewing the partially implemented opengl painter and used only one painter instance with each viewer (which was earlier 3 instances for background,foreground and document using cairo)<br />
<br />
> making the painter instance creation more robust starting from UI<br />
<br />
'''May 28th'''<br />
<br />
> Started with testing the drawables rendering with opengl painter , drawables doest require caching<br />
<br />
> Connect the signal(drawevent) and slot(grid's draw() code) , Tested the grid drawing calls with the opengl painter<br />
<br />
TODO: Debug later -- the zooming out of grid misses some lines<br />
<br />
'''May 29th'''<br />
<br />
> Connect the lccursor with drawevent signal , Tested the cursor drawing calls with the opengl painter<br />
<br />
'''May 30th'''<br />
<br />
> Connected the tempentities with the signal, Now the entities (during drawing/editing process) can also be rendered<br />
<br />
> Connected the dragpoints with the signal, Now the entities can be edited using dragpoints<br />
<br />
> Checked the editing options correct working like- translate, rotate, scale , copy etc<br />
<br />
'''May 31st'''<br />
<br />
> Found some errors in cursor during high zoom, debugging the lccursor<br />
<br />
> Trying to get the perfect viewport with error free pan and zoom so that later the new entities can be seen while testing<br />
<br />
'''June 1st'''<br />
<br />
> Separated the translate,rotate,scale matrix from the model,view,projection matrix in Renderer <br />
<br />
> Fixed the clipping of grid while zooming out also speed up the cursor at high zoom.<br />
<br />
'''June 2nd'''<br />
<br />
> Implemented the reset_transformation function <br />
<br />
> Now the zoom is perfect working , zooming into the cursor with stability<br />
<br />
> In Cairo all matrix are 3*3 so manually implemented all with 4*4 matrices in OpenGL Renderer Class<br />
<br />
== '''Week 2'''==<br />
<br />
'''June 3rd'''<br />
<br />
> Found need of Isolated Transformations<br />
<br />
> Need of context saving and restoring which stores the transformation matrices, linewidth, color etc<br />
<br />
'''June 4th'''<br />
<br />
> Created a structure which can save the context attributes like glm::mat , linewidth , color<br />
<br />
> Created Stack Implementation for the saving and restoring of context<br />
<br />
> Implemented the painters save() and restore() methods, now isolated transformations working correctly<br />
<br />
'''June 5th'''<br />
<br />
> Joined the lcvdimensions with the render calls, dimensions all working fine now<br />
<br />
> Temporary Implemented the rendering of empty quads in place of text , just to check the saving and restoring of context. Working fine<br />
<br />
'''June 6th'''<br />
<br />
> Implemented the Rotation Matrix manipulation methods<br />
<br />
> The Text Quads are now getting rendered with correct angle, working OK<br />
<br />
> Now the basic operations of OpenGL painter are functioning correct ( without caching mechanism )<br />
<br />
'''June 7th'''<br />
<br />
> Starting with Caching mechanism<br />
<br />
> Reviewing all draw() codes once again to design and finalize the gl_entity class<br />
<br />
'''June 8th'''<br />
<br />
> Found some possible errors which can clash with opengl painter<br />
<br />
> Fix those draw codes to work correctly with painter<br />
<br />
'''June 9th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 3''' ==<br />
'''June 10th'''<br />
<br />
> Found possible issue with multiple matrix transformations, Need to remember the transformations after caching<br />
<br />
> Redesigned the painter matrix manipulations with single CTM and MVP<br />
<br />
> Shifting the model matrix to caching painter<br />
<br />
'''June 11th'''<br />
<br />
> Understanding the kernel and storage part of librecad<br />
<br />
> Found the Signal and slot connections of events between the document and documentcanvas <br />
<br />
'''June 12th'''<br />
<br />
> Found error with the remove entity signal emitting code ( of paperviewer )<br />
<br />
> Fixed some function in storage manager to solve the issue , now entities are rendering OK in paperviewer tab also<br />
<br />
'''June 13th'''<br />
<br />
> Found the duplication of entities storing in entity container of document canvas<br />
<br />
> Tried to make a new cached container with key = id of entity<br />
<br />
'''June 14th'''<br />
<br />
> Found some issue with the draw code of paperbackground<br />
<br />
> Fixed the missing stroke() call , now the paper background is rendering correct ( Temporary as a white rectangle )<br />
<br />
'''June 15th'''<br />
<br />
> Reviewed all draw() codes and planned the structure of caching , things which are constant and which are variable<br />
<br />
> Updated the gl_entity class to hold attributes need in caching<br />
<br />
'''June 16th'''<br />
<br />
> BREAK<br />
<br />
== '''Week 4''' ==<br />
'''June 17th'''<br />
<br />
> Discussed the different ways of caching with mentors and decided to implement a particular<br />
<br />
> Started with making a separate class named caching painter which will only cache things without any rendering<br />
<br />
'''June 18th'''<br />
<br />
> Started making other classes like Cacher, gl_pack etc which will work in caching<br />
<br />
> Added few more functions in main painter and documentcanvas for making caching more abstracted<br />
<br />
'''June 19th'''<br />
<br />
> Continuing working on these classes<br />
<br />
'''June 20th'''<br />
<br />
> Almost completed with the gl_entity, gl_pack, cacher , cacherpainter classes<br />
<br />
> Now able to run the draw() codes through caching painter<br />
<br />
> Able to cache the gl_packs and implemented the required query functions regarding caching<br />
<br />
'''June 21st'''<br />
<br />
> Ran Caching with basic entities lines , circle , arc etc and with dimensions ( leaving text) all working OK<br />
<br />
> Fixed caching issues , all caching working OK<br />
<br />
> Found some signal issues in PAPER viewer while MODEL viewer is all OK<br />
<br />
'''June 22nd'''<br />
<br />
> BREAK<br />
<br />
'''June 23rd'''<br />
<br />
> Fixed the entity storage issue and signals<br />
<br />
> Changed the entityDrawItem map in document canvas with key as entity's ID<br />
<br />
> Cleaned the Code till now<br />
<br />
== '''Week 5''' ==<br />
'''June 24th'''<br />
<br />
> Started with updating the gl_entity to hold the attributes of text rendering<br />
<br />
> Making some temporary functions to render direct quads<br />
<br />
'''June 25th'''<br />
<br />
> Merged the old commits from the original repo <br />
<br />
> Resolved the issues during compiling and finally updating and cleaning the repo till worked done now<br />
<br />
> Submitted the first evaluation form<br />
<br />
'''June 26th'''<br />
<br />
> Got the Feedback on the caching mechanism implemented<br />
<br />
> Discussed with mentor how to separate the classes for different types<br />
<br />
'''June 27th'''<br />
<br />
> Started with separating the draw() code from renderer to entity class<br />
<br />
> Redesigning the structure of classes to work accordingly<br />
<br />
'''June 28th'''<br />
<br />
> Tried Compiling more than one shader working OK<br />
<br />
> One Shader for the basic shape drawing the second one for rendering the gradients<br />
<br />
== ''' <pre style="color: green"> Coding Period Phase 2 (June 29th - July 26th) </pre> ''' =