Comments (13)
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.
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.
@MaNGusT- : Could you upload a reduced sample mod that hits this error?
from warzone2100.
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.
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.
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.
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.
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.
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.
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.
It's okay to remove it, I didn't see that someone used it before.
from warzone2100.
No objections from me.
from warzone2100.
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)
- Keybind that work with commander
- Let the units blocking the road automatically give way to friendly forces. HOT 3
- Structures are slightly damaged when done building
- [QOL] Skip trucks in factory queue when truck limit reached HOT 1
- Track selected group number(s) (UI) HOT 1
- Software Rendering HOT 1
- displayScale config option resets to 150 when launching the game.
- Plasma Cannon Emplacement research is displayed as a Pulse Laser Emplacement HOT 1
- Plans to make a New Release? - Minor version to 4.4.3 with all latest committed changes / patches. HOT 9
- Cheat - add cheat code to match "Super Easy" difficulty setting for campaign
- Cheat - add cheat code to match "Insane" difficulty setting for campaign
- Choppy audio in cutscenes HOT 3
- [MP] Disappearing Factory HOT 1
- Flatpak version does not run with OpenGL on native Wayland HOT 3
- Crash build Ubuntu arm64 HOT 4
- Cheat - add 4 cheat codes to unlock and/or research all techs post Alpha and Beta campaign HOT 1
- Cheat - add 2 cheat codes around removing techs...
- WZ not loading addtional maps into game - using version 4.3.5 HOT 7
- Build fails: CMake Errors on 3rdparty - V 4.4.2 -D BUILD_SHARED_LIBS=OFF , no patches in use. HOT 5
- Quick Chat missing sound
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warzone2100.