Git Product home page Git Product logo

dragonfly's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

szilardh

dragonfly's Issues

Automatic shader version detection.

Shader files may contain #version line as the vers first line. When concatenating, this should be removed, and the maximum number used during compilation. Upon saving, the verstion should be written back.

ProgramEditor: Tabs

ProgramEditor can have more then just 2 shaders, in fact it can have 1 which must be a compute shader, or it can have both frag and vert, and optionally the other shaders: geometry, tessellation control and tessellation evaluation shaders. They need tabs if they are present accordingly.

Hint: if(std::is_same_v<TE, NoShader>) will be true if we have a tessellation evaluation shader.

ShaderEditor better UI

Currently is hard to manage all the files and edit them. I suggest having a "code editor" tab where the code editors of each file are after one another. This would be similar to the source code tab, but you could edit each file individually. The code editors would not get their own window, no docking, just one ImGui::ChildNode after the other.

The other tab could have the file selector and the error list below that.

This would also make the ProgramEditor look cleaner as you can see and edit the shaders better.

ShaderEditor error handling

Shader compilation errors are parsed and the line numbers are extracted using std::regex. Sometimes the template doesn't match the error, that needs investigation.

On AMD the errors look the same; however, the line numbers count from the beginning of the source code of the last file. On Nvidia and Intel the error line numbers are relative to the very first file, so I implemented a workaround. Thus, in case we have AMD hardware, we have to detect and fix this issue.

Program Editor: Compile button

Compile button is self explanatory, but you can have a shortcut (check if the ProgramEditor's window was the active window and the shortcut!)

ShaderEditor config file and operator << compatibility

As of now, if you save the ShaderEditor's contents to a config file (eg.: Shaders/_frag_shaders.config), but if the same shader editor (or the program that the shader editor is a part of) is being populated with shaders using operator <<, then the order in which they appear will be messed up. The errors you get will be non-trivial.

Each time we load a file using the << operator, we should check if that is already in it, and if it is, then move that to the back. (Maybe std::deque<File_t> shaders; in Shaders.h?)

Furthermore, clearing the contents should be an option.
General overhaul of the UI is also needed.

ProgramEditor: Error List

Program editor should list the errors that happend during linking.
Fancy list-like view has a low priority.

ProgramEditor class

A ProgramEditor should have error output and compile options, and also put the UI of it's shaders in it's own window. Program's uniforms should also be integrated into the UI.

The base class should be Program. Program should have an (optional) constructor with a name string. ProgramEditors should be constructed with a name. (Usefule for UI and error messages, for example: ProgramEditor<...> postproc ("Post Process");)

User Interface Overhaul

Issue: Too many windows at startup.
One or two windows should be enough to have it all.

TODO: Brainstorm and design.

Move semantics

Every OpenGL object wrapper class should follow move semantics. None of them should be copyable and all of them should be movable.
On move assigns we have to swap the OpenGL object names (ids) so the moved object's destructor can call the OpenGL delete function for the destroyed OpenGL object.
E.g. when a Program is move assigned we lose an OpenGL program name that we didn't delete.

UniformEditor fix

- Recompilations cause the UI list each uniform multiple times.
- Uniform locations should be of type uint16_t for storage

Bool uniforms

Missing boolean uniform variable support in Uniform class.

Add defines to a shader Program before compiling

It would be nice if we could add #define directives to shader programs.
E.g.:
prog << "USE_SHADOW"_def => #define USE_SHADOW
or
prog << "SHADOW_FUN"_def << 2 => #define SHADOW_FUN 2
or
prog << "SAMPLER_TYPE"_def << "sampler2d" => #define SAMPLER_TYPE sampler2d

Kind of like subroutines but in compile time.

Background colors indicating compile status

If the Shader didnt compile make its window/childwindow/tab with a dark red background. If the compilation was successful, the background could be dark green for a few frames. Do the same for ProgramEditor linking.
The files that had errors in them should have red collapsing headers.
When hitting the Program's compile button at most a single thing should be red because it should stop compiling then.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.