3dickulus
|
|
« Reply #105 on: December 09, 2013, 07:52:34 AM » |
|
trying out line numbers in the editor... I like it
|
|
|
|
SCORPION
|
|
« Reply #106 on: December 09, 2013, 10:55:20 AM » |
|
Very good! Now I look forward to highlighting syntax errors! :
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #107 on: December 10, 2013, 08:06:07 AM » |
|
I'm still fiddling with it but it should be completed soon. highlighting syntax errors because the word list is everything in GLSL then if it doesn't highlight it's not valid GLSL but it won't underline errors for you or do code completing by offering suggestions, maybe if I have the time it would be a good way to learn about all of the commands and functions. just for fun here's the list, let me know if I missed any //keywords break continue do for while if else true false discard return struct //types float int void bool mat2 mat3 mat4 vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow //type qualifiers attribute const uniform varying in out inout //Angle and Trigonometry Functions radians degrees sin cos tan asin acos atan //Exponential Functions pow exp log exp2 log2 sqrt inversesqrt //Common Functions abs sign floor ceil fract mod min max clamp mix step smoothstep //Geometric Functions length distance dot cross normalize ftransform faceforward reflect refract //Matrix Functions matrixCompMult //Vector Relational Functions lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not //Texture Lookup Functions texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod //Fragment Processing Functions dFdx dFdy fwidth //Noise Functions noise1 noise2 noise3 noise4 //Vertex Shader Special Variables gl_Position gl_PointSize gl_ClipVertex //Fragment Shader Special Variables gl_FragCoord gl_FragFacing gl_FragColor gl_FragData gl_FragDepth // Vertex Shader Built-in Attributes gl_Color gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogColor //Built-in Constants gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttributes gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxCombinedTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxDrawBuffers //Built-in Uniform State gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixInverse gl_ModelViewMatrixTranspose gl_ProjectionMatrixTranspose gl_ModelViewProjectionMatrixTranspose gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormScale gl_DepthRangeParameters gl_DepthRange gl_ClipPlane gl_PointParameters gl_Point gl_MaterialParameters gl_FrontMaterial gl_BackMaterial gl_LightSourceParameters gl_LightSource gl_LightModelParameters gl_LightModel gl_LightModelProducts gl_FrontLightModelProduct gl_BackLightModelProduct gl_LightProducts gl_FrontLightProduct gl_BackLightProduct gl_TextureEnvColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_ObjectPlaneS gl_ObjectPlaneT gl_ObjectPlaneR gl_ObjectPlaneQ gl_FogParameters gl_Fog //Varying Variables gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_Color gl_SecondaryColor
|
|
|
Logged
|
|
|
|
eiffie
Guest
|
|
« Reply #108 on: December 10, 2013, 04:21:27 PM » |
|
I haven't made an error for so long (hahaha) I don't know if Fragmentarium still displays the line number for the error as the combined source line#. It would be nice if the line numbering could match with the error line number.
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #109 on: December 10, 2013, 04:57:23 PM » |
|
It would be nice if the line numbering could match with the error line number. yeah it would, I think it might be figured out from a dump of the processed script after all the parts are put together and stripped of comments and such, just having the numbers in the editor helps, oh duh! I could just offset those eh? good idea, maybe when I'm done fiddling with the highlighting, as time permits I found an xml file that lists everything from 1.0 to 4.3 , using #version should let the highlighter figure out what to strike out or underline, if no #version tag then default to 1.1 or 1.2... something like that. Edit: offset applied, error line on compile matches line number in display
|
|
« Last Edit: December 10, 2013, 07:30:04 PM by 3dickulus, Reason: :D »
|
Logged
|
|
|
|
eiffie
Guest
|
|
« Reply #110 on: December 10, 2013, 07:37:48 PM » |
|
Excellent! That will be a big help when writing complex scripts.
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #111 on: December 10, 2013, 08:10:43 PM » |
|
not extensively tested but seems to work on Mandelbulb.frag (#includes 4 other files) and Gi.frag (#includes 2 other files) so I'm taking it for granted as functional. I think this is only good for errors in the user script and may or may not be accurate for files with the #donotrun tag as they don't get sent to the GPU when in the editor.
|
|
|
Logged
|
|
|
|
Syntopia
|
|
« Reply #112 on: December 10, 2013, 09:39:59 PM » |
|
yeah it would, I think it might be figured out from a dump of the processed script after all the parts are put together and stripped of comments and such, just having the numbers in the editor helps, oh duh! I could just offset those eh? good idea, maybe when I'm done fiddling with the highlighting, as time permits I found an xml file that lists everything from 1.0 to 4.3 , using #version should let the highlighter figure out what to strike out or underline, if no #version tag then default to 1.1 or 1.2... something like that. Edit: offset applied, error line on compile matches line number in display Ye olde Fragmentarium already does that, if you click at a line, the statusbar should show the line number from the final combined script in the statusbar - notice that this should also work for any included "#donotrun" files if they are open in the editor (see screenshot).
|
|
|
|
3dickulus
|
|
« Reply #113 on: December 10, 2013, 10:56:08 PM » |
|
lol, toooche, of course it does, blind as a bat sometimes, if it was any closer it would have bit me, well, the line numbers I put in the editor are accurate for the user scripts like Mandelbulb.frag in sync with the status bar. There will be a preferences flag to turn them off. loaded BufferShader.frag and status bar says (Not part of current script) ? with 3D.frag it says the first line is line 7, but my numbering scheme says the first line is 636, I'm pretty sure that's wrong. the new highlighter works quite well, I deleted the highlighter class stuff from MainWindow.cpp and moved it to Highlighter.h and fixed a couple of minor bugs, now #include it in MainWindow.cpp. Attached if you would like to look it over
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #114 on: December 12, 2013, 02:58:57 PM » |
|
So... I have just updated the exe and sources on my website, this incarnation of Fragmentarium now has version sensitive highlighting Good for 1.0 - 4.3 defaults to 1.1 . Now any commands or variables that are not valid for the currently set version get a strike throughIn general all commands in versions lower than currently set version will not have a strike through , I think there is room in there for some syntax error handling and maybe contextual help, command completion, or code snipits, or just info about the hovered command. It would be nice to have someone who knows GLSL very well take this for a test ride... Syntopia? Kali? Eiffie? Dr. Wiessenhimer? the source code and win exe are available
|
|
|
Logged
|
|
|
|
Syntopia
|
|
« Reply #115 on: December 12, 2013, 10:10:38 PM » |
|
Looks nice!
How do I turn on the line number offsets?
I also played a bit around with the strike through thing - I notice that if I wrote for instance 'sample' it was striked though, but I don't think it is a keyword in any GLSL version?
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #116 on: December 12, 2013, 10:45:48 PM » |
|
tnx, did you try the source or exe from my web site? the file I posted above is a free standing piece ie: it can be used with QTextEdit or QPlainTextEdit or QDocument without any special requirements, just include and call like > new Highlighter(textEdit) < . the source and exe from my site are a bit different. The line numbers are part of your TextEdit class, look at the bottom of MainWindow.h, QTextEdit is accessed through your class now, all instances of QTextEdit are now TextEdit. I put the line numbers back to a no-offset state, it wasn't quite right anyway and the status bar has a line number that is relevant for debugging. You can turn them off/on in the preferences dialog. QRegEx is not my specialty so my rules may not be the best, the word "sample" is listed as a v4.0 word so if #version is less than 400 it will strike outI haven't put deprecated or ES conditions in yet, it's only based on version numbers 100 to 430. If you grab the source.zip it has a QtCreator.pro file named Fragmentarium-Source.pro that I used to compile on windows. I had to pre-create the headers from the ui files and edit them to get it to compile on win but it's all there so it should be a point and click opperation. I noticed that "r1" strikes out too, not sure why ... it's not perfect but comming along nicely
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #117 on: December 12, 2013, 11:37:28 PM » |
|
I've also noticed that the GPU compiler puts out some useful messages that don't show in the log dock, like...
0(167) : warning C7555: 'varying' is deprecated, use 'in/out' instead 0(220) : warning C7533: global variable gl_FragColor is deprecated after version 120
I only see these in the error console output when I run it in my IDE, I think it would be helpful to see these. they're just warnings and the script still compiles and runs but knowing is better than not seeing them at all.
|
|
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #118 on: December 16, 2013, 03:16:38 PM » |
|
The 3Dickulus version of Fragmentarium now requires an xml syntax highlighting file in the Misc folder, sorry no fallback, no description = no highlighting. In particular this file glsl.xml from http://renderingpipeline.com/2013/12/glsl-syntax-highlighting-for-opengl-4-4/This might allow highlighting of other shader languages too like cg or cl by just swapping the xml file, haven't tested though. The definition has the following features: Support for desktop OpenGL up to 4.4 (with all keywords, build-in functions, constants and variables), as well as OpenGL ES 2.0 and OpenGL ES 3.0 (and WebGL as it uses ES 2 shaders). Detects the shader version per file based on the #version definition! Unsupported keywords, build-in variables and functions are marked as such based on the detected GLSL version. Marks the ‘special parameters’ inside of layout() declarations based on the GLSL version (those are not keywords according to the specs so they are not marked outside of a layout() declaration).(QtCreator only?) The current limitations are: The shader type itself (Compute Shader, Geometry Shader etc.) does not get detected – it would be possible to create six different XML files with slightly different rules to only mark keywords useful/supported per shader stage (in case the file ending is sufficient to make this distinction). Version 130 and later assume core and mark compatibility build-ins as unsupported. In #version 300 es for OpenGL ES 3, only one space between the ’300′ and the ‘es’ are allowed. What it means is that the syntax highlighting in Fragmentarium will allways be up to date, version sensitive and can be customized through the xml file Merry X-Mass (glsl.xml included)
|
|
« Last Edit: December 16, 2013, 04:35:10 PM by 3dickulus, Reason: OGL 4.4 ! »
|
Logged
|
|
|
|
3dickulus
|
|
« Reply #119 on: December 17, 2013, 01:12:40 AM » |
|
yay it seems to work and you can specify colors in the xml file like "darkRed" or "#880000" ( gif anim )
|
|
« Last Edit: December 17, 2013, 01:14:44 AM by 3dickulus »
|
Logged
|
|
|
|
|