Design : GLSL compile #118862
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118862
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The GLSL language was implemented in the text editor in
462c144f41
. The objective now is to be able to compile the shaders created so that they can be applied to objects.For this I have two solutions but I don't know which one to choose.
The first is to create a new file which would contain the code below and allow it to compile. These two parts of code are together in the same file.
#include <cstdio> GLuint LoadShader(GLenum type, const char *filename) { Gluint shader = 0; GLsizei logsize = 0; GLint compile_status = GL_TRUE; char *log = NULL; char *src = NULL;
}
`
the advantage is that there is normally not much additional development to be done and the code seems simple. The downside is that you will probably need to include OpenGL or other files and this possibly creates a 2nd compilation system in Blender.
The 2nd solution would be to use an already existing system (if it exists) and use it. The advantage is that there is no new implementation to do. The disadvantage is that you have to do longer searches and the results will require more code, take longer to develop and increase the risk of reference problems, bugs, conflicts possibly...
I could try to finish Pr #113938 to have better performance but without guarantees and without rapid results
but before starting development I wanted to collect opinions or advice on the subject
Python already has a GPU module that allows compiling GLSL shaders.
Unless I'm missing something that already covers what you're describing, and it has the advantage of working on Metal too.
The goal is not to use python to create a shader but to be able to press the execute button and execute custom GLSL shaders. so you need a system to compile the shaders
Plus I would like it to work on all platforms.
Executing shaders in what context? Could you provide a specific example of how a user would use this?
For example you write the following shader in the blender text editor.
you will want to execute it on an
object in your scene for example. You must therefore compile the shader and execute it and this is where the compilation system comes in. When you press run this compiles the shader and runs it on where the objects.
I think for something like what you describe, compiling a shader is the least of your problems, and something that is already supported anyway.
Your example seems to be missing many details, and still doesn't clarify what the actual goal is (why is this better than a
draw_handler
?). And your GLSL code doesn't make sense (you're mixing a compute and a vertex shader on the same file ?)I would suggest you to explore your ideas by building an addon first.
the code of shader have create by Clément Foucault in #116793 and i don't check if was good.
@pragma37 For me GLSL no compile when write the script and no execute