Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different Render Texture formats #17

Closed
CptPotato opened this issue Aug 31, 2019 · 10 comments
Closed

Different Render Texture formats #17

CptPotato opened this issue Aug 31, 2019 · 10 comments

Comments

@CptPotato
Copy link

CptPotato commented Aug 31, 2019

There doesn't seem to be a way to change the format of a render texture right now. Other formats are sometimes better suited or even required for effects to work. For example, this is needed when working with HDR rendering or buffers that require high precision.

On the graphics API side there's a lot of formats available, while the support on different platforms or older GPUs is probably hit or miss. As possible additions I suggest the 16 and 32 bit float variants with 4 channels (for example DXGI_FORMAT_R16G16B16A16_FLOAT/DXGI_FORMAT_R32G32B32A32_FLOAT in DirectX). These should be widely supported and offer a high precision & range, allowing for a wide range of use cases.

There are other interesting formats, too, which come into play when optimizing shaders but I'm not sure if this is worth the additional effort.

Edit: I just remembered there were some limitations in older APIs where using multiple rendertargets with different formats had drastic limitations. I'm not sure if SHADERed is also affected by this, which would make this feature pretty difficult to implement.

@dfranx
Copy link
Owner

dfranx commented Sep 1, 2019

Thanks for the suggestion! Implemented!

I have added a large number of texture formats. SHADERed requires OpenGL 3.3 core (which is somewhat new) so I don't think that there should be any problems with format support on older GPUs.

I don't think SHADERed is affected by those limitations. I tried using random formats in the deferred rendering example, and it kept working perfectly fine.

Also, I am going to close this now, but if you find any bug feel free to open new issue related to that bug.

@dfranx dfranx closed this as completed Sep 1, 2019
@dfranx
Copy link
Owner

dfranx commented Sep 3, 2019

Hey! I just want to notify you that I've released the binaries that include this feature + fix for GeometryTransform's last frame value.

PS: I have also added some nifty features that allow you to test your shaders in a more effective way - one of those features being able to zoom in/out of the render texture (more info in changelog). This way you can see close-up of your AA shader.

@CptPotato
Copy link
Author

CptPotato commented Sep 3, 2019

@dfranx thanks again for the great work. I can confirm that the new RT formats and transform-fix work as expected. Though this new version has introduced 2 problems.

All Sampler States inside shaders seem to have changed from linear filtering to point filtering with this update - causing problems when it comes to scaling and mixed resolution rendertargets:
grafik
Notice the really choppy bloom effect. This screenshot is at a 1:1 scale (without the zooming feature).

I suspect it's because of the addition of the zooming feature (which I like btw. 👍).
The other issue is that something seems to mess up rendering of 3D Models (the ones generated internally still work). I don't have anything concrete to hint at, though.

@dfranx
Copy link
Owner

dfranx commented Sep 3, 2019

Thanks for testing so quickly!

Yeah, the bug came alongside the zooming feature.. If you can compile yourself then change these two lines https://github.com/dfranx/SHADERed/blob/master/Objects/ObjectManager.cpp#L78-L79 to use GL_LINEAR instead of GL_NEAREST otherwise wait 'till I push a fix tomorrow. It shouldn't even affect the zooming feature, I don't know why I have changed that :/

As for the second bug, I have no idea whats causing that problem.. It is so weird. I will investigate more tomorrow and hopefully push a fix..

Sorry for introducing major app breaking bugs with every release...

@dfranx
Copy link
Owner

dfranx commented Sep 3, 2019

I've actually found what causes the second bug too. Might push a fix now but if not just pass "item" variable as an argument here
https://github.com/dfranx/SHADERed/blob/master/Objects/RenderEngine.cpp#L219

@CptPotato
Copy link
Author

CptPotato commented Sep 3, 2019

Sorry for introducing major app breaking bugs with every release...

No worries, I assume this is a one man project so updating it so frequently is probably a lot of work, so take your time. I just ran into these issues because I used this app so much in the past few days 🙃.

I did some debugging and it seems that vertex data isn't bound properly which I think fits the issues you highlighted:
grafik

@dfranx
Copy link
Owner

dfranx commented Sep 3, 2019

Thank you for using it and reporting all these bugs and features! Helps a lot!

I have just pushed a hotfix for Windows versions (the Linux one is still broken)... It should work now - both render textures and models. I wasn't setting the matrices for models properly. Thanks for reporting once again! Hope all works now!

@dfranx
Copy link
Owner

dfranx commented Sep 4, 2019

@CptPotato have you tried the updated v1.1.3? Is it working now?

@CptPotato
Copy link
Author

Yes, much better! Both the filtering and 3d models work again.
grafik

@dfranx
Copy link
Owner

dfranx commented Sep 4, 2019

Damn that looks super nice!

AlvaroRuizDelgado added a commit to AlvaroRuizDelgado/SHADERed that referenced this issue Dec 21, 2019
* Cross platform update

* Minor CMake changes

* Use inotify for file watcing on linux

* Fix for dfranx#5

* Fix GLSL shaders + fix for a bug that occurs when using multiple textures

* Add steps for Windows in the README

* Add FindGLM.cmake

* Variable pointers

* Small fix for variable pointers

* Shader macros

* fix sdl linking on Linux

* Update CHANGELOG

* Fix for dfranx#13

* Add FrameIndex system variable dfranx#14

* Add option that disables RT clear dfranx#15

* UIHelper -> include clocale

* Shader variable flags dfranx#12

* Fix CopyState() crash

* Fix last frame flag for GeometryTransform dfranx#12

* Disable last frame for IsPicked + change var manager default size

* Icons

* Add format property to render textures dfranx#17

* Add toolbar

* Add elapsed time to status bar + make the toolbar buttons work

* Pause and increase time

* Fix float4/int4/bool4 variables

* Add Mouse and MouseButton system variables

* Zoom in/out functionality

* Zoom controls

* Fix RT filtering and model rendering

* Fix a bug where SHADERed would crash with multiple 3D models dfranx#18

* Replace glm::identity<glm::mat4>() with glm::mat4(1) dfranx#6

* Add option to reset time

* Fix zoom area dragging & limit zoom selection bounds

* Add CTRL+ALT+MWheel to zoom in/out

* Add FindSFML.cmake

* Add USE_FINDSFML variable

* Add cubemap preview

* Fix picking when zoomed in

* Improve gizmo, bounding box & zoom area performance

* Add option to modify system variables when rendering to an image

* macOS changes

* Object preview window

* Fix CMakeLists.txt

* Add proper cubemap and audio preview to the object preview window

* Add buffers

* Add instancing

* Add ability to use buffers as inputs for instanced objects

* Fix 3D model instancing

* Make it compilable on windows

* Add auto check for updates on startup

* Add buffer to toolbar & minor improvements to UpdateChecker

* Update TextEditor dfranx#19

* Add show whitespace option

* Update external libraries

* Add auto recompile option - compile changed shaders every 200ms

* Add option to disable window's alpha channel

* Add ScreenQuadNDC

* Add the ability to set CodeUI.Save and Project.Save to same shortcut

* Add option to stream logs to file

* Bump version

* Fix loading files from different drives on Windows dfranx#18

* Add ImageObject

* Add compute shaders

* Compute shader examples + fixes

* Minor changes

* Update README.md & TUTORIAL.md

* Fix README gif

* Remove some gifs

* Fix crash on RWTexture2D

* Fix crash on HLSL function calls with no arguments (update glslang)

* Fix various transcompiler crashes

* Various TextEditor fixes (check CHANGELOG) - update ImGuiColorTextEdit submodule

* Fix a bug that occurs when fetching texel data from a texture without a sampler

* Write item type in the properties

* Use different color to write shader pass with an error in the PipelineUI

* Disable various path textboxes

* Prevent pause button from overlapping

* Update TextEditor, add hlsl compute example, bump version

* Add Vulkan GLSL support dfranx#21

* Minor fixes

* Add input layout (dfranx#25)

* Exporting/importing shader pass input layout

* Add input layout manager

* Fix tangents and bitangents

* Add option to export a sequence of images dfranx#23

* Improve performance mode dfranx#24

* Various fixes & changes

* Add CameraPosition3 and CameraDirection3 variables

* Add drag & drop

* Add 'Are you sure?' message box

* Multiple bug fixes

* Rework ImageObject & fix ScreenQuadNDC rendering

* Add resource manager

* Add CTRL+F/search box in the text editor

* Fix for dfranx#27

* Fix a bug where SHADERed would recompile file two times after clicking Compile button

* Add ability to change variable type after variable has been created

* Add a window where all system variables are listed

* Add magnifier tool to object preview window

* Make it so that any form of project save also saves all shader code modifications

* Shader code modifications now also count as project modifications

* Minor changes

* Add context menu and replace feature in the text editor & fix copy and paste functionalities

* Some internal changes to the magnifier tool in ObjectPreviewUI

* Detect if some Editor shortcuts are missing

* Remove all the maps from ObjectManager

* Fix for gcc

* Fixes

* Add support for HLSL types in the buffer format

* Recompile shader pass after we change it's shader path

* Add ability to change warning, message and error text colors in the theme files

* CodeEditorUI now holds pointers to PipelineItems

* Close code editors after a shader pass has been deleted

* Add feature that automatically creates variables when creating a shader pass

* Add Editor.FindNext & improve text editor find feature

* Add 3D textures

* Add Project -> Options

* Fix 3D textures

* Fix texture loading

* Add various checks to prevent crashes

* Add multi-camera system (+ ShadowMapping example) & fix matrix variable export/import

* Update readme

* Add audio shaders (+ audioshader example)

* Update libraries

* Update TODO.md

* Fix a bug where openning Sobel -> Edge -> Sobel examples would break the rendered

* Fix a crash on openning 'cubemap' example

* Update README.md & settings.ini

* Improve image sequence export speed & add ability to use sprintf format specifiers in filename (dfranx#23)

* Add Fedora Dependencies

* Scroll to the selection & fix FindNext highlighting

* Update TODO.md

* Fix Editor.Find and Editor.Replace shortcuts

* Fix HOME/END shortcuts

* Fix gizmo interaction when preview is zoomed in

* Add drag & drop to PipelineUI

* Bump version

* Add ability to deactivate certain shader pass

* Pausing preview now also pauses compute shaders

* Improve TextEditor shortcuts

* Revert

* Update TODO.md & CHANGELOG.txt

* Fix a bug where TextEditor would lose focus on ALT key press

* Plugin API base

* Fixed missed return ArcBallCamera '=' operator

* Fixed missed return value for '=' operator

* Memory leak fix

```
		if (m_item.Data != nullptr)
			delete m_item.Data;
```
m_item.Data:
https://github.com/dfranx/SHADERed/blob/24ba95faebfde61581a08792b82f5ad2cb13d69f/Objects/PipelineItem.h#L45

it leads to mem leak as 'delete' operator can't delete 'void*' proper. (not type information -> not size data, and no information about destructor, ... )
https://github.com/dfranx/SHADERed/blob/24ba95faebfde61581a08792b82f5ad2cb13d69f/Objects/PipelineItem.h#L45
i.e. destructors of internal fields (ex https://github.com/dfranx/SHADERed/blob/24ba95faebfde61581a08792b82f5ad2cb13d69f/Objects/PipelineItem.h#L78)  won't be executed.

* Mem-leak fix

Base class should have a virtual destructor otherwise delete (UIView*) ... won't be able to call derived destructor (even a default one).

* Add support for #include

* Update TODO.md & minor changes to KeyboardShortcuts (dfranx#35)

* Fix #include's for HLSL

* Fix message line numbers when using #include in GLSL shaders

* Add 'Recursive #include detected' message

* Update default theme & font (dfranx#9)

* Add an option to save supersampled screenshots (dfranx#34)

* Update imgui

* Add search in Options -> Shortcuts

* Bump version

* Add ability to load projects by drag and dropping them

* Toolbar item for openning projects should now also show 'Are you sure?' message box

* Somewhat fix autocomplete and find window background colors

* Update and expand the API

* Hide object view window in performance mode

* Add MSAA (dfranx#36)

* Change how MouseButton works

* Fix a bug where user could select same RT multiple times for the same pass

* Fix camera rotation loading from project file

* Add ability to add custom system variable types

* Check if user doesn't have required plugins for a project

* Add ability to disable certain plugins

* Consistency between auto-recompile and normal recompile when using #include

* Add ability to add custom functions

* Add ability to install SHADERed binaries (dfranx#33)

* make install -> lowercase (dfranx#33)

* Compiles on linux

* Plugins can now add custom ObjectManager items

* Add PipelineItem::PluginItem

* Fixes, improvements & add various plugin functions

* Add GetPluginVersion() & fix bugs

* More fixes

* Update shortcuts.kb

* Add ShowContextItems(pluginitem_add, item_type)

* Add GetDPI, Log, FileExists, ClearMessageGroup to plugin API

* Add GetObjectCount, GetObjectName, IsTexture, GetTexture, GetTextureSize plugin functions + fix pipelineitem_add

* Add XDG desktop and AppData files for Linux integration

This also installs those files in CMake to expose SHADERed
to the application launcher once installed.

* Add BeginRender and EndRender to PluginAPI

* Prevent SHADERed from crashing when plugins directory doesn't exist (dfranx#38)

* Cache PluginItems in RenderEngine

* Add BindDefaultStateFn

* Add ability to check for changes in plugin's custom files

* Plugin API can now access CodeEditorUI features

* Auto recompile now works with plugin items

* Plugin API changes

* Prevent crashes when one of the directories (themes, templates, data) doesn't exist

* Create data directory if it doesn't exist

* Update plugin API

Co-authored-by: Franx <dfranx00@gmail.com>
Co-authored-by: CuriousTommy <CuriousTommy@users.noreply.github.com>
Co-authored-by: Denis <denis.ovod@gmail.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants