Text Editor: Add GLSL support language #116793

Closed
Gangneron wants to merge 68 commits from Gangneron/blender:Add_GLSL into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

Pr adds the GLSL language to the text editor.
The objective is to be able to create your own GLSL shaders in blender. This improves the workflow since all shader programming can be done directly in Blender. In addition, the GLSL language is a very popular language in the video games industry and even in general.
The goal is then to also support HSLS in the same way in order to have a complete solution with OSL, GLSL and HLSL
If there are any key words or other missing words, tell me

I use GLSL 4.3 doc.
I use GLSL 4.3 for corresponding to OpenGL version

Pr adds the GLSL language to the text editor. The objective is to be able to create your own GLSL shaders in blender. This improves the workflow since all shader programming can be done directly in Blender. In addition, the GLSL language is a very popular language in the video games industry and even in general. The goal is then to also support HSLS in the same way in order to have a complete solution with OSL, GLSL and HLSL If there are any key words or other missing words, tell me I use GLSL 4.3 doc. I use GLSL 4.3 for corresponding to OpenGL version
Gangneron added 1 commit 2024-01-04 17:18:36 +01:00
bb9ba761c8 Text Editor: Add GLSL support language
Pr adds the Glsl language to the text editor.
The objective is to be able to create your own GLSL shaders in blender. This improves the workflow since all shader programming can be done directly in Blender. In addition, the GLSL language is a very popular language in the video games industry and even in general.
The goal is then to also support HSLS in the same way in order to have a complete solution with OSL, GLSL and HLSL
If there are any key words or other missing words, tell me
Author
First-time contributor
@ideasman42
Iliya Katushenock added this to the Python API project 2024-01-04 21:46:45 +01:00
Iliya Katushenock added the
Interest
Text Editor
Interest
User Interface
labels 2024-01-04 21:46:54 +01:00
Gangneron requested review from Campbell Barton 2024-01-05 14:40:36 +01:00
Gangneron requested review from Iliya Katushenock 2024-01-05 14:40:37 +01:00
Iliya Katushenock refused to review 2024-01-05 14:42:04 +01:00
Gangneron requested review from Sergey Sharybin 2024-01-05 15:12:00 +01:00
Gangneron requested review from Clément Foucault 2024-01-05 15:12:00 +01:00
Gangneron added 1 commit 2024-01-05 15:25:23 +01:00
Gangneron added 1 commit 2024-01-05 19:14:02 +01:00
Gangneron added 1 commit 2024-01-05 19:50:02 +01:00
Gangneron requested review from Sybren A. Stüvel 2024-01-05 20:47:33 +01:00
Gangneron added 1 commit 2024-01-05 20:57:29 +01:00
57d33bb8c6 Add uvec
Add uvec2, uvec3 and uvec4 in list and "in"
Gangneron added 1 commit 2024-01-05 21:05:09 +01:00
3162c3f35f Big update
Add head, Add "uvec", "flat" and "in" update comment
Clément Foucault requested changes 2024-01-05 21:48:29 +01:00
Dismissed
@ -0,0 +49,4 @@
"mat4"
"out"
"return"
"sampler1D"

You are missing a lot of sampler types. (u|i)sampler((1|2|3)D|Cube|Buffer)(Array)(Shadow) is the pattern of all possible types.

Edit: forgot shadow sampler and buffer sampler.

You are missing a lot of sampler types. `(u|i)sampler((1|2|3)D|Cube|Buffer)(Array)(Shadow)` is the pattern of all possible types. Edit: forgot shadow sampler and buffer sampler.
Author
First-time contributor

ok thank you, but when I look at the file for osl there are a lot fewer elements so I ask myself a question: either I put too many elements or some are missing in the file for osl

ok thank you, but when I look at the file for osl there are a lot fewer elements so I ask myself a question: either I put too many elements or some are missing in the file for osl
Author
First-time contributor

i update list of keyword

i update list of keyword
fclem marked this conversation as resolved
Gangneron added 1 commit 2024-01-06 15:18:11 +01:00
cd2504959e Add a lot of keywords
i add a lot of keyword of GLSL. For that i use GLSL  4.3 doc : https://docs.gl/sl4/all
Gangneron added 1 commit 2024-01-06 15:22:16 +01:00
Gangneron requested review from Clément Foucault 2024-01-06 15:23:25 +01:00
Author
First-time contributor

@fclem i update Pr and i add what you normally asked me

@fclem i update Pr and i add what you normally asked me
Gangneron added 1 commit 2024-01-08 19:34:23 +01:00
Author
First-time contributor

Could you tell me if there are still missing keywords or if some are not placed in the right category. Likewise, the Built-In var must be in a dedicated function called builtinvar for example ?
Thank you for your response and review.

Could you tell me if there are still missing keywords or if some are not placed in the right category. Likewise, the Built-In var must be in a dedicated function called builtinvar for example ? Thank you for your response and review.
Gangneron added 1 commit 2024-01-08 21:40:18 +01:00
Gangneron added 1 commit 2024-01-08 21:48:20 +01:00
Gangneron added 1 commit 2024-01-08 21:52:33 +01:00
Gangneron added 1 commit 2024-01-08 21:57:24 +01:00
Gangneron added 1 commit 2024-01-08 22:00:36 +01:00
Clément Foucault requested changes 2024-01-08 22:41:02 +01:00
Dismissed
@ -0,0 +24,4 @@
static int textformat_glsl_literals_builtinfunc_data[]
{
"Array"

I don't know what this Array is. And why is it with uppercase A?

I don't know what this `Array` is. And why is it with uppercase `A`?
Gangneron marked this conversation as resolved
@ -0,0 +115,4 @@
"volatile"
"while"
"#define"
"#defined"

I don't know how to handle that, but preprocessor directive can be nested and not glued to the # symbol. That's the usual usecase for defined.

I don't know how to handle that, but preprocessor directive can be nested and not glued to the `#` symbol. That's the usual usecase for `defined`.
Author
First-time contributor

i fix problem but maybe I could put that in the text_format_glsl_find_preprocessor function

i fix problem but maybe I could put that in the text_format_glsl_find_preprocessor function
Author
First-time contributor

@ideasman42 what do you think of my idea of creating a function?

@ideasman42 what do you think of my idea of creating a function?
fclem marked this conversation as resolved
@ -0,0 +167,4 @@
"dFdy"
"distance"
"dot"
"dxdx"

I don't think this exists. Same goes for the dxdy, dydx and dydy.

I don't think this exists. Same goes for the `dxdy`, `dydx` and `dydy`.
Gangneron marked this conversation as resolved
@ -0,0 +192,4 @@
"greaterThan"
"greaterThanEqual"
"groupMemoryBarrier"
"idexp"

It's ldexp not idexp. If you did this list by hand, other typos might have slept in. So i would suggest to not do manually and use an official list somewhere like https://docs.gl/sl4/acos (left panel, expand all sections).

It's `ldexp` not `idexp`. If you did this list by hand, other typos might have slept in. So i would suggest to not do manually and use an official list somewhere like https://docs.gl/sl4/acos (left panel, expand all sections).
Gangneron marked this conversation as resolved
@ -0,0 +390,4 @@
if (txtfmt_glsl_find_specialvar(str) != -1) {fmt = FMT_TYPE_SPECIAL;}
else if (txtfmt_glsl_find_builtfunc(str) != -1) {fmt = FMT_TYPE_KEYWORD;}

You should run make format to avoid any custom formatting issues.

This block is copy pasted from an area which uses /* clang-format off */. So either drop the special formatting or make sure it is correctly formatted and add back the /* clang-format off */. Same goes for the other occurrence of this part.

You should run `make format` to avoid any custom formatting issues. This block is copy pasted from an area which uses `/* clang-format off */`. So either drop the special formatting or make sure it is correctly formatted and add back the `/* clang-format off */`. Same goes for the other occurrence of this part.
Gangneron marked this conversation as resolved
Author
First-time contributor

Ok thanks you but i work with endline on LF

Ok thanks you but i work with endline on LF
Campbell Barton requested changes 2024-01-09 12:55:50 +01:00
Campbell Barton left a comment
Owner

Requesting minor changes.

Requesting minor changes.
@ -0,0 +19,4 @@
#include "text_format.hh"
/*---------------------------------------------------------------------*/
Use doxy-sections, https://developer.blender.org/docs/handbook/guidelines/c_cpp/#comment-sections
Gangneron marked this conversation as resolved
@ -0,0 +288,4 @@
/*Add in futur verion when GLSL 4.5 support in Blender*/
/*"textureSamples"*/
/*Built-In Variable */

Use spaces within C-style comments, e.g. /* Built-In Variable */

Use spaces within C-style comments, e.g. `/* Built-In Variable */`
Author
First-time contributor

normally all comment problems are corrected

normally all comment problems are corrected
Gangneron marked this conversation as resolved
@ -0,0 +548,4 @@
str++;
}
/* Terminate and add continuation char */

End comments with full-stops.

End comments with full-stops.
Gangneron marked this conversation as resolved
Gangneron added 1 commit 2024-01-09 14:41:18 +01:00
Gangneron requested review from Campbell Barton 2024-01-09 14:41:30 +01:00
Gangneron requested review from Clément Foucault 2024-01-09 19:33:21 +01:00
Gangneron added 1 commit 2024-01-09 19:35:34 +01:00
Gangneron added 1 commit 2024-01-09 19:48:07 +01:00
Campbell Barton requested changes 2024-01-09 22:56:59 +01:00
Campbell Barton left a comment
Owner

There are quite a few errors in the code, it seems like the PR in it's current form can't have been compiled/tested.

There are quite a few errors in the code, it seems like the PR in it's current form can't have been compiled/tested.
@ -0,0 +10,4 @@
/*"include <cstring> can be replace by import std:string;"*/
#include "BLI_blendlib.h"

This header doesn't exist.

This header doesn't exist.
Gangneron marked this conversation as resolved
@ -0,0 +23,4 @@
/* Define all keywords who can use
*/
static int textformat_glsl_literals_builtinfunc_data[] = {

Wrong type.

Wrong type.
Gangneron marked this conversation as resolved
@ -0,0 +392,4 @@
} else if (txtfmt_glsl_find_builtfunc(str) != -1) {fmt = FMT_TYPE_KEYWORD;
} else if (txtfmt_glsl_find_reserved(str) != -1) {fmt = FMT_TYPE_RESERVED;
} else if (txtfmt_glsl_find_preprocessor(str) != -1) {fmt = FMT_TYPE_DIRECTIVE;
} else {fmt = FMT_TYPE_DEFAULT;

Missing closing brace.

Missing closing brace.
Gangneron marked this conversation as resolved
@ -0,0 +406,4 @@
FlattenString fs;
const char *str;
char *fmt;
char cont_orig, cont, find, prev = '';

empty character constant

empty character constant
Author
First-time contributor

I don't see what I need to change

I don't see what I need to change
Author
First-time contributor

c'est un code identique à text_format_osl

c'est un code identique à text_format_osl

What is the value of prev expected to be? Two single quotes without spaces doesn't define a character. OSL for example sets prev = ' '.

What is the value of prev expected to be? Two single quotes without spaces doesn't define a character. OSL for example sets `prev = ' '`.
fclem marked this conversation as resolved
@ -0,0 +526,4 @@
/* keep in sync with `txtfmt_glsl_format_identifier()`. */
if ((i = txtfmt_glsl_find_specialvar(str)) != -1) {prev = FMT_TYPE_SPECIAL;
}else if ((i = txtfmt_glsl_find_builtinfunc(str)) != -1) {prev = FMT_TYPE_KEYWORD;

Function doesn't exist.

Function doesn't exist.
Gangneron marked this conversation as resolved
Gangneron added 1 commit 2024-01-10 18:35:05 +01:00
Gangneron added 1 commit 2024-01-10 18:43:07 +01:00
Gangneron requested review from Campbell Barton 2024-01-10 18:44:31 +01:00
Campbell Barton requested changes 2024-01-11 00:46:05 +01:00
Campbell Barton left a comment
Owner

This patch doesn't compile on GCC, clang-format has also not been applied.

Errors include:

/src/blender/source/blender/editors/space_text/text_format_glsl.cc:11:10: fatal error: BLI_blendlib.h: No such file or directory
   11 | #include "BLI_blendlib.h"
      |          ^~~~~~~~~~~~~~~~
rs/space_text/CMakeFiles/bf_editor_space_text.dir/text_format_glsl.cc.o -c /src/blender/source/blender/editors/space_text/text_format_glsl.cc
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:407:38: error: empty character constant
  407 |   char cont_orig, cont, find, prev = '';
      |                                      ^~
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:24:14: error: ‘textformat_glsl_literals_builtinfunc_data’ does not name a type
   24 | static const textformat_glsl_literals_builtinfunc_data[] = {
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:129:5: error: ‘textformat_glsl_literals_builtinfunc_data’ was not declared in this scope; did you mean ‘textformat_glsl_literals_builtinfunc’?
  129 |     textformat_glsl_literals_builtinfunc_data,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     textformat_glsl_literals_builtinfunc
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:130:16: error: ‘textformat_glsl_literals_builtinfunc_data’ was not declared in this scope; did you mean ‘textformat_glsl_literals_builtinfunc’?
  130 |     ARRAY_SIZE(textformat_glsl_literals_builtinfunc_data));
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                textformat_glsl_literals_builtinfunc
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:335:15: error: no matching function for call to ‘ARRAY_SIZE(const char*&)’
  335 |     ARRAY_SIZE(*text_format_glsl_literals_specialvar_data));
      |     ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /src/blender/source/blender/blenlib/BLI_listbase.h:12,
                 from /src/blender/source/blender/blenlib/BLI_blenlib.h:39,
                 from /src/blender/source/blender/editors/space_text/text_format_glsl.cc:11:
/src/blender/source/blender/blenlib/BLI_utildefines.h:837:46: note: candidate: ‘template<class T, long unsigned int N> constexpr size_t ARRAY_SIZE(const T (&)[N])’
  837 | template<class T, size_t N> constexpr size_t ARRAY_SIZE(const T (&arg)[N]) noexcept
      |                                              ^~~~~~~~~~
/src/blender/source/blender/blenlib/BLI_utildefines.h:837:46: note:   template argument deduction/substitution failed:
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:335:15: note:   mismatched types ‘const T [N]’ and ‘const char*’
  335 |     ARRAY_SIZE(*text_format_glsl_literals_specialvar_data));
      |     ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/blender/source/blender/editors/space_text/text_format_glsl.cc: In function ‘void ED_text_format_register_glsl()’:
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:576:28: error: expected ‘;’ before ‘ED_text_format_register’
  576 |   tft.comment_line = "/**/" ED_text_format_register(&tft);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
      |                            ;
In file included from /src/blender/source/blender/blenlib/BLI_utildefines.h:19:
/src/blender/source/blender/editors/space_text/text_format_glsl.cc:579:54: error: ‘textformat_glsl_literals_builtinfunc_data’ was not declared in this scope; did you mean ‘textformat_glsl_literals_builtinfunc’?
  579 |       text_format_string_literals_check_sorted_array(textformat_glsl_literals_builtinfunc_data));
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/src/blender/source/blender/blenlib/BLI_assert.h:51:15: note: in definition of macro ‘BLI_assert’
   51 |     (void)((!(a)) ? ((_BLI_assert_print_backtrace(), \
      |               ^
This patch doesn't compile on GCC, clang-format has also not been applied. Errors include: ``` /src/blender/source/blender/editors/space_text/text_format_glsl.cc:11:10: fatal error: BLI_blendlib.h: No such file or directory 11 | #include "BLI_blendlib.h" | ^~~~~~~~~~~~~~~~ ``` ``` rs/space_text/CMakeFiles/bf_editor_space_text.dir/text_format_glsl.cc.o -c /src/blender/source/blender/editors/space_text/text_format_glsl.cc /src/blender/source/blender/editors/space_text/text_format_glsl.cc:407:38: error: empty character constant 407 | char cont_orig, cont, find, prev = ''; | ^~ /src/blender/source/blender/editors/space_text/text_format_glsl.cc:24:14: error: ‘textformat_glsl_literals_builtinfunc_data’ does not name a type 24 | static const textformat_glsl_literals_builtinfunc_data[] = { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /src/blender/source/blender/editors/space_text/text_format_glsl.cc:129:5: error: ‘textformat_glsl_literals_builtinfunc_data’ was not declared in this scope; did you mean ‘textformat_glsl_literals_builtinfunc’? 129 | textformat_glsl_literals_builtinfunc_data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | textformat_glsl_literals_builtinfunc /src/blender/source/blender/editors/space_text/text_format_glsl.cc:130:16: error: ‘textformat_glsl_literals_builtinfunc_data’ was not declared in this scope; did you mean ‘textformat_glsl_literals_builtinfunc’? 130 | ARRAY_SIZE(textformat_glsl_literals_builtinfunc_data)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | textformat_glsl_literals_builtinfunc /src/blender/source/blender/editors/space_text/text_format_glsl.cc:335:15: error: no matching function for call to ‘ARRAY_SIZE(const char*&)’ 335 | ARRAY_SIZE(*text_format_glsl_literals_specialvar_data)); | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /src/blender/source/blender/blenlib/BLI_listbase.h:12, from /src/blender/source/blender/blenlib/BLI_blenlib.h:39, from /src/blender/source/blender/editors/space_text/text_format_glsl.cc:11: /src/blender/source/blender/blenlib/BLI_utildefines.h:837:46: note: candidate: ‘template<class T, long unsigned int N> constexpr size_t ARRAY_SIZE(const T (&)[N])’ 837 | template<class T, size_t N> constexpr size_t ARRAY_SIZE(const T (&arg)[N]) noexcept | ^~~~~~~~~~ /src/blender/source/blender/blenlib/BLI_utildefines.h:837:46: note: template argument deduction/substitution failed: /src/blender/source/blender/editors/space_text/text_format_glsl.cc:335:15: note: mismatched types ‘const T [N]’ and ‘const char*’ 335 | ARRAY_SIZE(*text_format_glsl_literals_specialvar_data)); | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /src/blender/source/blender/editors/space_text/text_format_glsl.cc: In function ‘void ED_text_format_register_glsl()’: /src/blender/source/blender/editors/space_text/text_format_glsl.cc:576:28: error: expected ‘;’ before ‘ED_text_format_register’ 576 | tft.comment_line = "/**/" ED_text_format_register(&tft); | ^~~~~~~~~~~~~~~~~~~~~~~~ | ; In file included from /src/blender/source/blender/blenlib/BLI_utildefines.h:19: /src/blender/source/blender/editors/space_text/text_format_glsl.cc:579:54: error: ‘textformat_glsl_literals_builtinfunc_data’ was not declared in this scope; did you mean ‘textformat_glsl_literals_builtinfunc’? 579 | text_format_string_literals_check_sorted_array(textformat_glsl_literals_builtinfunc_data)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /src/blender/source/blender/blenlib/BLI_assert.h:51:15: note: in definition of macro ‘BLI_assert’ 51 | (void)((!(a)) ? ((_BLI_assert_print_backtrace(), \ | ^ ```
Gangneron added 1 commit 2024-01-11 18:40:01 +01:00
Gangneron added 1 commit 2024-01-11 19:26:52 +01:00
Gangneron requested review from Campbell Barton 2024-01-11 20:21:35 +01:00
Gangneron added 1 commit 2024-01-11 20:24:18 +01:00
Gangneron added 1 commit 2024-01-11 21:42:45 +01:00

@Gangneron are you compiling & testing these changes?

The latest updates still fail making it seem this PR can't have even been tested.

@Gangneron are you compiling & testing these changes? The latest updates still fail making it seem this PR can't have even been tested.
Author
First-time contributor

I don't understand where most of the errors come from knowing that part of the code comes directly from the OSL file. do you have an explanation for this? Furthermore, certain completely external files seem to pose a problem on this patch but not on the others even though they are up to date.

I don't understand where most of the errors come from knowing that part of the code comes directly from the OSL file. do you have an explanation for this? Furthermore, certain completely external files seem to pose a problem on this patch but not on the others even though they are up to date.
Author
First-time contributor

i can't compile because the CMAKE file of datadoc have a error an error although I have not modified it

i can't compile because the CMAKE file of datadoc have a error an error although I have not modified it
Gangneron closed this pull request 2024-01-13 16:32:09 +01:00
Gangneron reopened this pull request 2024-01-13 16:32:20 +01:00
Gangneron added 1 commit 2024-01-13 16:45:53 +01:00
Gangneron added 1 commit 2024-01-13 16:51:07 +01:00
Gangneron added 1 commit 2024-01-13 16:52:30 +01:00
Gangneron added 1 commit 2024-01-13 16:53:20 +01:00
Gangneron added 1 commit 2024-01-13 16:54:28 +01:00
Gangneron added 1 commit 2024-01-13 16:56:01 +01:00
Gangneron added 1 commit 2024-01-13 17:09:47 +01:00
Author
First-time contributor

@blender-bot build-branch branch

@blender-bot build-branch branch
Member

Only blender organization members with write access can start builds. See documentation for details.

Only blender organization members with write access can start builds. See [documentation](https://projects.blender.org/infrastructure/blender-bot/src/branch/main/README.md) for details.
Author
First-time contributor

@ideasman42 can you use blender-bot build-branch branch please for i want view errors of build

@ideasman42 can you use blender-bot build-branch branch please for i want view errors of build

@Gangneron what is the environment your using to develop the patch?

Please make sure the patch builds without introducing new warnings/errors on this environment.

@Gangneron what is the environment your using to develop the patch? Please make sure the patch builds without introducing new warnings/errors on this environment.
Author
First-time contributor

i use visual studio community or visual studio code.
Bur if i compile Blender project i have one error of datadoc CMAKE File after compile so i can't compile.
This is why I would like you to ask blender boot to report its error to me. Because certain errors mentioned above are not possible given that the other files which are called have no problem even though the code is identical.

i use visual studio community or visual studio code. Bur if i compile Blender project i have one error of datadoc CMAKE File after compile so i can't compile. This is why I would like you to ask blender boot to report its error to me. Because certain errors mentioned above are not possible given that the other files which are called have no problem even though the code is identical.

Having to get someone else to run the buildbot for you isn't a practical way to do development,
please investigate the cause of compiling to fail.

You can ask for help here:


Marking as WIP until the patch is updated & tested to compile.

Having to get someone else to run the buildbot for you isn't a practical way to do development, please investigate the cause of compiling to fail. You can ask for help here: - https://devtalk.blender.org/c/building-blender/11 - `#blender-builds` room in `blender.chat`. ---- Marking as WIP until the patch is updated & tested to compile.
Campbell Barton changed title from Text Editor: Add GLSL support language to WIP: Text Editor: Add GLSL support language 2024-01-14 23:38:30 +01:00
First-time contributor

1d41434bb2

this is working in the upbge fork

any text named .glsl in the editor is hinted I think*
image

https://github.com/UPBGE/upbge/commit/1d41434bb2c1026d56fdede8dea7b68236437bf7 this is working in the upbge fork any text named .glsl in the editor is hinted I think* ![image](/attachments/c24be91e-334e-4493-b82d-05e367775576)
526 KiB
Gangneron added 1 commit 2024-01-17 15:09:38 +01:00
Gangneron added 1 commit 2024-01-17 15:26:12 +01:00
Gangneron added 1 commit 2024-01-17 15:31:19 +01:00
Author
First-time contributor

@ideasman42 normally it's good, I didn't find any errors.
In any case if there are errors in my file there are also some in text_format_osl.cc

@ideasman42 normally it's good, I didn't find any errors. In any case if there are errors in my file there are also some in text_format_osl.cc
Gangneron added 1 commit 2024-01-17 15:36:57 +01:00
Campbell Barton requested changes 2024-01-17 23:29:24 +01:00
Campbell Barton left a comment
Owner

This branch isn't compiling & the patch now includes many unrelated changes.

This branch isn't compiling & the patch now includes many unrelated changes.
Author
First-time contributor

Okay I'm going to remove these changes. However, I didn't quite understand the beginning of your message.

Okay I'm going to remove these changes. However, I didn't quite understand the beginning of your message.
Gangneron added 1 commit 2024-01-18 12:35:25 +01:00
Author
First-time contributor

I delete during the day the files that should be deleted from this PR

I delete during the day the files that should be deleted from this PR
Author
First-time contributor

And after normally will be good for fusion

And after normally will be good for fusion
Gangneron added 1 commit 2024-01-18 19:29:41 +01:00
Gangneron added 1 commit 2024-01-18 19:31:01 +01:00
Gangneron requested review from Campbell Barton 2024-01-18 19:31:21 +01:00
Campbell Barton requested changes 2024-01-18 21:51:23 +01:00
Campbell Barton left a comment
Owner

edit not syntax errors but the patch fails to compile.


There are various syntax errors still.

Please only request review once you have compiled this patch locally and tested it to work.

*edit* not syntax errors but the patch fails to compile. ---- There are various ~~syntax~~ errors still. Please only request review once you have compiled this patch locally and tested it to work.
Author
First-time contributor

i don't undrstand error. question do you have the same problem when you compile text_format_osl.cc?

i don't undrstand error. question do you have the same problem when you compile text_format_osl.cc?
Author
First-time contributor

when I want to compile I have errors on CMAKE files not modified or not the line in question

when I want to compile I have errors on CMAKE files not modified or not the line in question
Author
First-time contributor

the syntax is identique a text_format_osl.cc

the syntax is identique a text_format_osl.cc

when I want to compile I have errors on CMAKE files not modified or not the line in question

If you have errors compiling, this needs to be addressed before further development.

> when I want to compile I have errors on CMAKE files not modified or not the line in question If you have errors compiling, this needs to be addressed before further development.
Author
First-time contributor

when I want to compile I have errors on CMAKE files not modified or not the line in question

If you have errors compiling, this needs to be addressed before further development.

okay but it's files not modified and extern of PR

> > when I want to compile I have errors on CMAKE files not modified or not the line in question > > If you have errors compiling, this needs to be addressed before further development. okay but it's files not modified and extern of PR
Author
First-time contributor

edit not syntax errors but the patch fails to compile.


There are various syntax errors still.

Please only request review once you have compiled this patch locally and tested it to work.

strange because the code is logically identical to that of the osl language

> *edit* not syntax errors but the patch fails to compile. > > ---- > > There are various ~~syntax~~ errors still. > > Please only request review once you have compiled this patch locally and tested it to work. strange because the code is logically identical to that of the osl language
Author
First-time contributor

1d41434bb2

this is working in the upbge fork

any text named .glsl in the editor is hinted I think*
image

when you write GLSL script can you execute the code ?

> https://github.com/UPBGE/upbge/commit/1d41434bb2c1026d56fdede8dea7b68236437bf7 > > this is working in the upbge fork > > any text named .glsl in the editor is hinted I think* > ![image](/attachments/c24be91e-334e-4493-b82d-05e367775576) when you write GLSL script can you execute the code ?
Gangneron added 1 commit 2024-01-18 22:38:30 +01:00
Gangneron added 1 commit 2024-01-18 22:39:53 +01:00
Author
First-time contributor

I am open to suggestions for change if you have any.

I am open to suggestions for change if you have any.
Gangneron added 1 commit 2024-01-27 19:02:02 +01:00
Gangneron added 1 commit 2024-01-27 19:04:40 +01:00
Author
First-time contributor

@ideasman42 every problem fix. of my part the code is good.

@ideasman42 every problem fix. of my part the code is good.

when I want to compile I have errors on CMAKE files not modified or not the line in question

If you have errors compiling, this needs to be addressed before further development.

This is still the case, what compiler are you using? can you confirm this compiles for you without warnings?

> > when I want to compile I have errors on CMAKE files not modified or not the line in question > > If you have errors compiling, this needs to be addressed before further development. This is still the case, what compiler are you using? can you confirm this compiles for you without warnings?

If this is ready for review, please remove the "WIP:" prefix from the title, as that indicates "do not review this yet, it is still work in progress".

If this is ready for review, please remove the "WIP:" prefix from the title, as that indicates "do not review this yet, it is still work in progress".
First-time contributor

1d41434bb2

this is working in the upbge fork

any text named .glsl in the editor is hinted I think*
image

when you write GLSL script can you execute the code ?

Yeah, upbge has a 2d filter system that can run in post vs each frame, we can also use gpu module to run custom glsl.

> > https://github.com/UPBGE/upbge/commit/1d41434bb2c1026d56fdede8dea7b68236437bf7 > > > > this is working in the upbge fork > > > > any text named .glsl in the editor is hinted I think* > > ![image](/attachments/c24be91e-334e-4493-b82d-05e367775576) > > when you write GLSL script can you execute the code ? Yeah, upbge has a 2d filter system that can run in post vs each frame, we can also use gpu module to run custom glsl.
Author
First-time contributor

For now, I'm going to test the custom GLSL script compilation integration. But you have to check the file compilation

For now, I'm going to test the custom GLSL script compilation integration. But you have to check the file compilation
Gangneron added 1 commit 2024-02-08 17:32:34 +01:00
Author
First-time contributor

after reflexion i go create new Pr for implement of custom GLSL script compile

after reflexion i go create new Pr for implement of custom GLSL script compile
Gangneron changed title from WIP: Text Editor: Add GLSL support language to Text Editor: Add GLSL support language 2024-02-08 17:39:10 +01:00
Author
First-time contributor

@dr.sybren can you review code please.

@dr.sybren can you review code please.
Gangneron added 1 commit 2024-02-11 16:20:03 +01:00
Gangneron requested review from Campbell Barton 2024-02-14 18:50:08 +01:00
Gangneron added 1 commit 2024-02-14 19:03:50 +01:00
Clément Foucault requested changes 2024-02-14 19:59:50 +01:00
Dismissed
@ -0,0 +241,4 @@
"texelFetchOffset"
"texture"
"texture1D"
"texture1DLod"

These texture*Lod keywords doesn't exist. Only textureLod is valid.

These `texture*Lod` keywords doesn't exist. Only `textureLod` is valid.
Author
First-time contributor

i delete keywords

i delete keywords
Gangneron marked this conversation as resolved
Campbell Barton changed title from Text Editor: Add GLSL support language to WIP: Text Editor: Add GLSL support language 2024-02-15 01:38:51 +01:00

@Gangneron please confirm you are actually compiling and testing this PR, resolving warnings and checking it works as expected.
Once this is done, remove the WIP prefix and it can be reviewed.

@Gangneron please confirm you are actually compiling and testing this PR, resolving warnings and checking it works as expected. Once this is done, remove the WIP prefix and it can be reviewed.
Gangneron added 1 commit 2024-02-15 19:34:18 +01:00
Gangneron added 1 commit 2024-02-15 19:35:17 +01:00
Clément Foucault added 17 commits 2024-02-25 20:22:35 +01:00

I made it compile and fixed the few issues that were remaining. This should be good to go now.

I made it compile and fixed the few issues that were remaining. This should be good to go now.
Clément Foucault changed title from WIP: Text Editor: Add GLSL support language to Text Editor: Add GLSL support language 2024-02-25 20:30:06 +01:00
Author
First-time contributor

@fclem Thank you very much for fix problems of compile

@fclem Thank you very much for fix problems of compile
Author
First-time contributor

But I have questions. How indicate preprocessing instructions?

But I have questions. How indicate preprocessing instructions?

But I have questions. How indicate preprocessing instructions?

I would say keeping only the first keyword highlighted is enough and improves readability. That's what OSL does too.

> But I have questions. How indicate preprocessing instructions? I would say keeping only the first keyword highlighted is enough and improves readability. That's what OSL does too.
Author
First-time contributor

Ok
So I tag ideasman42 for relect ?

Ok So I tag ideasman42 for relect ?
Clément Foucault approved these changes 2024-02-25 20:58:32 +01:00
Dismissed
Clément Foucault left a comment
Member

You can, but I think he will see it anyway.

I just need to fix the else clauses not being properly highlighted. But for me that's fine to land already.

You can, but I think he will see it anyway. I just need to fix the `else` clauses not being properly highlighted. But for me that's fine to land already.
Author
First-time contributor

Sorry if I don't Sorry if I couldn't resolve the issues myself. Thanks a lot for your help.

Sorry if I don't Sorry if I couldn't resolve the issues myself. Thanks a lot for your help.
Author
First-time contributor

For add the GLSL compile i would do the research for know how do before create a Pr

For add the GLSL compile i would do the research for know how do before create a Pr

Ah the keyword table is still not sorted appropriately. Let me figure out.

Ah the keyword table is still not sorted appropriately. Let me figure out.
Author
First-time contributor

Else I can seen tomorrow

Else I can seen tomorrow
Clément Foucault added 2 commits 2024-02-25 21:21:10 +01:00
Clément Foucault approved these changes 2024-02-25 21:27:13 +01:00
Clément Foucault left a comment
Member

@Gangneron Just so you know for next time, don't use the PR as general conversation channel. If you want to coordinate work with other developpers, use https://blender.chat/channel/blender-coders . The PR is usually made to discuss the technical details. Otherwise the PR gets noisy and it's difficult for reviewers to find the relevant information.

@Gangneron Just so you know for next time, don't use the PR as general conversation channel. If you want to coordinate work with other developpers, use https://blender.chat/channel/blender-coders . The PR is usually made to discuss the technical details. Otherwise the PR gets noisy and it's difficult for reviewers to find the relevant information.

@fclem thanks for the fixes, committed 462c144f41 with one functional change:

-  tft.comment_line = "/**/";
+  tft.comment_line = "//";

Otherwise toggling comments would insert /**/ before the text without commenting it.

@fclem thanks for the fixes, committed 462c144f414343ffbbac3546f1fae2bbf0bd52db with one functional change: ```diff - tft.comment_line = "/**/"; + tft.comment_line = "//"; ``` Otherwise toggling comments would insert `/**/` before the text without commenting it.
Campbell Barton closed this pull request 2024-02-26 02:04:46 +01:00
Author
First-time contributor

@ideasman42 can I perform the merge?

@ideasman42 can I perform the merge?

This has been committed to main, 462c144f41

This has been committed to main, 462c144f414343ffbbac3546f1fae2bbf0bd52db
Author
First-time contributor

Ok thank you. Today i add compilation system in new Pr and i ask how to modify the documentation and the release note.

Ok thank you. Today i add compilation system in new Pr and i ask how to modify the documentation and the release note.
Added to release notes: blender/blender-developer-docs@8b6d9a3dc30bea97a9469abdaa7fa297b7424264.
Gangneron reopened this pull request 2024-03-04 18:16:49 +01:00
Gangneron closed this pull request 2024-03-04 18:17:03 +01:00

Pull request closed

Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#116793
No description provided.