Commit Graph

14 Commits

Author SHA1 Message Date
Clément Foucault
fe213f80a4 GPU: Shader: Make info files generated
This is the first step of moving the create infos
back inside shader sources.

All info files are now treated as source files.
However, they are not considered in the include tree
yet. This will come in another following PR.

Each shader source file now generate a `.info` file
containing only the create info declarations.

This renames all info files so that they do not
conflict with their previous versions that were
copied (non-generated).

Pull Request: https://projects.blender.org/blender/blender/pulls/146676
2025-09-25 10:57:02 +02:00
Clément Foucault
bb8e987904 GPU: Simplify matrix lib to reduce dead code
This greatly reduce shader compilation time on some systems.

Pull Request: https://projects.blender.org/blender/blender/pulls/146100
2025-09-15 12:07:26 +02:00
Casey Bianco-Davis
fbbd79aa50 Grease Pencil: Improve cyclical end cap rendering
This improves the rendering of cyclical strokes in Grease Pencil
by connection the start and end lines segments together.

To make this possible the Vertex Shader needs to know if the
curve is cyclical and the start and end of the current stroke.
This PR stores the cyclical in the sign of `point index`. All points
already know the start of the curve as `stroke_id`, so all we
need is the end of the curve. Grease Pencil already uses a
point at the start and end of the stroke as padding.  So if the
first buffer point stored the index to the last buffer point, any
other point and just go to the first point then to the last.

Pull Request: https://projects.blender.org/blender/blender/pulls/143976
2025-08-13 13:00:32 +02:00
Jeroen Bakker
3aba58b94a Cleanup: Make format 2025-04-29 13:49:24 +02:00
Falk David
1d6f313995 Grease Pencil: Remove minimum thickness clamping
This removes the minimum thickness clamping in the shader.
The reason why this was clamped in the first place was to reduce
aliasing artifacts. With the new super sampling method for
rendering, this should no longer be an issue.

Note: This can break visual compatibility, but the previous radii
were arguably "wrong". This essentially fixes this and renders
the strokes with the actual radii from the attribute.
Previous files that might have relied on the clamping will have
to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/138119
2025-04-29 12:46:48 +02:00
Clément Foucault
3f11d16501 Cleanup: DRW: Make all shader resource snake case
This make sure that the DRW folder is compliant to our codestyle.

Pull Request: https://projects.blender.org/blender/blender/pulls/137673
2025-04-24 12:50:45 +02:00
Clément Foucault
3b3a5731df GPU: Shader: Change vector and matrix type to use blender convention
This unify the C++ and GLSL codebase style.

The GLSL types are still in the backend compatibility
layers to support python shaders. However, the C++
shader compilation layer doesn't have them to enforce
correct type usage.

Note that this is going to break pretty much all PRs
in flight that targets shader code.

Rel #137261

Pull Request: https://projects.blender.org/blender/blender/pulls/137369
2025-04-14 13:46:41 +02:00
Clément Foucault
bb52754652 GPU: Use f suffix for float literals
They are actually already some literals with the `f` suffix
that are in our shader codebase and we never had problem in
the past 5 years (or even 8 years).

So I think it is safe to do and improves convergence of codestyles.

Pull Request: https://projects.blender.org/blender/blender/pulls/137352
2025-04-11 18:28:45 +02:00
Clément Foucault
e36cc4dcf7 Cleanup: Grease Pencil: Remove uneeded push-constants
All of these push-constants were either redundant or
not used anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/135561
2025-03-06 15:14:05 +01:00
Clément Foucault
bb2d123fbd Cleanup: DRW: Remove ObjectInfos legacy GLSL macros
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/135542
2025-03-06 11:06:26 +01:00
Clément Foucault
9bddb57960 Cleanup: DRW: Relace drw_view macros by function calls 2025-03-05 15:31:35 +01:00
Clément Foucault
a92f6ebf13 Cleanup: DRW: Remove ModelMatrix legacy GLSL macros 2025-03-05 15:31:35 +01:00
Clément Foucault
cb7d9222cf Cleanup: DRW: Remove legacy object data create infos
Remove deprecated (and unused) create infos and mass
rename the `*_new` ones.
2025-02-25 18:46:42 +01:00
Clément Foucault
a15a4c9c9a GPU: GLSL compilation as C++ for grease pencil shaders
Rel #127983
2024-12-02 13:21:12 +01:00