Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

Easy shaders #59

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Easy shaders #59

wants to merge 19 commits into from

Conversation

melody-rs
Copy link
Member

@melody-rs melody-rs commented May 24, 2022

  • Ability to compile shaders from ruby
  • Set shader uniforms from ruby
  • Application methods
    • Sprite.shaders
    • Viewport.shaders
    • Bitmap.apply_shader
    • Plane.shaders
  • Automatic type conversion from ruby (Bitmap -> sampler2D, Integer -> int, etc)
  • Ditch usage of #include "binding-util.h" (hopefully)

@melody-rs
Copy link
Member Author

  • Tweak XXD to add include gaurds

@melody-rs
Copy link
Member Author

melody-rs commented May 25, 2022

  • Vec2 & Vec4 don't set values properly (maybe?)
  • Shaders don't stack
  • Shader deconstruction is messy, usually results in an assertion error
  • Rename args to uniforms instead as its a misleading name
  • Optimize where possible
  • Remove the extra shader include (requires adding include guards to xxd)

@melody-rs
Copy link
Member Author

  • Add extra shader uniform detections (alpha, tone, etc)

@melody-rs melody-rs marked this pull request as draft June 16, 2022 06:19
@melody-rs melody-rs requested a review from somedevfox June 16, 2022 06:19
@Eblo
Copy link

Eblo commented Nov 22, 2022

Hello! I found a bug and also have a potential fix that I have in my own fork. Shader linking seems to fail, but only on certain machines.

Between testing 4 different machines, it looks like shader linking fails when running a machine with integrated graphics. The default mkxp shaders seem to work fine, but compiling custom shaders through this setup would throw "Shader linking failed with", except the log would be completely empty.

Some stackoverflow-ing later, I found that the specific issue of empty shader logs comes when you try to link a fragment shader without a vertex shader https://stackoverflow.com/questions/21555186/glsl-shader-linking-fail-but-no-log

I implemented an admittedly lazy fix of assuming the vertex shader is always handled after the fragment shader. This is good enough for me, but you may or may not want to do something more robust. Here is my own fix for reference. Let me know if you can't access it: Eblo/mkxp-eulogy@c587418

@melody-rs
Copy link
Member Author

Thank you! I'm no longer maintaining ModShot but I'll see what I can do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants