Git Product home page Git Product logo

Comments (13)

past-due avatar past-due commented on May 22, 2024

Will take a look into this.

The shaders directive has some other potential issues - especially if WZ (in the future) supports multiple backends (i.e. OpenGL and Vulkan).

from warzone2100.

MaNGusT- avatar MaNGusT- commented on May 22, 2024

I believe it fails on this lines for me, they come first after void main.
#if (!defined(GL_ES) && (__VERSION__ >= 130)) || (defined(GL_ES) && (__VERSION__ >= 300))
vec4 pixel = texture(Texture, texCoord);
#else
vec4 pixel = texture2D(Texture, texCoord);
#endif
Probably that's coz I create shader for model in effects folder. Also, model is PIE 2.

from warzone2100.

past-due avatar past-due commented on May 22, 2024

@MaNGusT- : Could you upload a reduced sample mod that hits this error?

from warzone2100.

MaNGusT- avatar MaNGusT- commented on May 22, 2024

I've just tried to adapt some code from the internet to wz to see how it looks(I'm not a coder, you know :D), but it fails at start (line 7), can't even fix other errors that probably exist. Just experiment.
blow.zip
Btw, those errors were on work pc, at home it gives me another error.

from warzone2100.

MaNGusT- avatar MaNGusT- commented on May 22, 2024

Errors above were due to my temporary files in base folder. After I cleaned it and saved only necessary files I got this error
info |11:44:04: [readShaderBuf:154] Could not open blow.vert
info |11:44:04: [readShaderBuf:154] Assert in Warzone: ``C:\projects\warzone2100\lib\ivis_opengl\piestate.cpp:154 (fp != nullptr), last script event: '<none>'

from warzone2100.

MaNGusT- avatar MaNGusT- commented on May 22, 2024

Well, fixed almost all errors. 1) Custom shaders must be located at root of base folder, not in shaders directory. 2) SHADERS directive must contain only needed shaders without value 2 SHADERS blow.vert blow.frag
it still gives me nice errors like
GL_INVALID_OPERATION error generated. Invalid component count.
GL_INVALID_OPERATION error generated. <location> is invalid.
GL_INVALID_OPERATION error generated. <apiElementType> value is invalid; expected GL_INT or GL_UNSIGNED_INT64_NV.

or it gives me another error depending on matrix I use in vertex shader:
GL_INVALID_OPERATION error generated. The operation is invalid when the uniform is a matrix.
blow2.zip
If now errors are only shader related, and wz's code is fine, let me know, I will close this issue.

from warzone2100.

past-due avatar past-due commented on May 22, 2024

I believe if you change the SHADERS directive to include the path (relative to the root of the mod) you can put them in the shaders directory.

i.e. SHADERS shaders/blow.vert shaders/blow.frag

(If that doesn't work please let me know.)

from warzone2100.

MaNGusT- avatar MaNGusT- commented on May 22, 2024

It has helped, ty. But I still get The operation is invalid when the uniform is a matrix If I use ModelViewProjectionMatrix
Is there a right matrix for effects?

from warzone2100.

inodlite avatar inodlite commented on May 22, 2024

On top of the issues mentioned above I think there is some memory corruption or something along those lines whenever one is using shaders directive. I was getting a random AV every other time I start wz with a shadered PIE file. Admittedly this was on a branch with normals, but all AVs went away as soon as I stopped trying to use shaders directive and simply modified tcmask shader for my tests.

from warzone2100.

past-due avatar past-due commented on May 22, 2024

In addition to the above-mentioned issues, future support of multiple graphics backends (ex. OpenGL and Vulkan) makes the per-PIE-file SHADERS directive (as it currently stands) problematic.

Instead of going down the rabbit hole of trying to fix all of these issues, are there any objections to deprecating the current SHADERS directive, until the architecture and handling of multiple graphics backends settles out and we have a bit more time to think about and discuss what might be a suitable replacement?

from warzone2100.

MaNGusT- avatar MaNGusT- commented on May 22, 2024

It's okay to remove it, I didn't see that someone used it before.

from warzone2100.

inodlite avatar inodlite commented on May 22, 2024

No objections from me.

from warzone2100.

past-due avatar past-due commented on May 22, 2024

With #380 merged, I'm going to close this issue for now. We can revisit (if desired) once the architecture and handling of multiple graphics backends settles out.

from warzone2100.

Related Issues (20)

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.