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
Merge @paroj changes while avoiding the use of the RTSS and OgreBites. #202
Conversation
Working on it. |
I'm having crash in all demos 'read access violation. this->mCurrentVertexProgram was nullptr.' when |
Also I don't have any issues with Demo_Colors. Looks correct (again, DX11 only) |
Just in case, right now I'm working on Windows 10, Ogre 1.12.9+ (actually I'm using master branch from 09 Nov 2020). So hopefully we are on similar setups for now. Once we are done with windows I'll test other platforms. |
@sercero Ok, I got some results here:
By the way UnitTest_Layers works on OpenGL platform, so you can see what to expect as a result. I'll try to figure out what's wrong with the RTT on DirectX11. What about 3d models shaders, did you succeeded with any demos without using RTSS? Because there is only one shader required, there are just simple 3d models with texture and nothing else. (I also removed not used particles files) |
I'm also going to try latest Ogre from master, since there was at least one related fix. |
@Altren that is strange because at first I was not using the I have the shaders for the 3D models, bear in mind that these shaders just apply the texture and nothing else. I thought it would be best to use the RTSS because UnitTest_Layers uses materials with multiple textures and blending which I don't know how to do in a shader. Anyway I will submit a PR with the shaders I made. Regarding UnitTest_RTTLayer in DirextX11 I found a particular behaviour with the solution made by paroj: in DirectX9 and 11 UnitTest_RTTLayer works OK, but in OpenGL and 3+ the small RTT window is flipped vertically I think you should take a look at what paroj has done because I think there lies the solution to the problem. I am very upset that the initial changes I made that had UnitTest_RTTLayer working were lost because I was using git improperly and deleted all the changes in error. |
That's the point of YFlipScale shader parameter, that was removed by paroj, it fixes texture flipping, that happens on OpenGL platforms. |
the RTSS generated shader uses the modelviewproj matrix. See #194 (comment) |
Thanks @paroj I will try to see the shaders generated by RTSS to see how the This parameter would be set with At one point I was setting the value of YFlipScale like this: In December I will start learning about shaders, I'm tired of not understanding the basics. |
the RTSS uses the matrix instead of YFlipScale this works as (with mat2 for brevity)
whereas YFlipScale you do
|
Thank you @paroj . With @sercero I'll finish all changes soon and merge into master. |
@paroj That's odd, but even ACT_RENDER_TARGET_FLIPPING is always 1.0 for me. For OpenGL, OpenGL3 and DirectX11 |
It comes from GLWindow::requiresTextureFlipping that is false. I guess that wrong render target is asked, because material have RTT texture set as regular texture: pass->getTextureUnitState(0)->setTexture(texture->getOgreTexture()); |
ah.. ACT_RENDER_TARGET_FLIPPING is -1 when rendering into the RTT not when rendering the RTT itself |
@paroj Sorry, I was wrong, and the code I mentioned is not the RTT, rendered into something, that's actually some part of the GUI skin rendered into RTT. |
I feel, that I miss some Ogre's API, because I can make it work by hacking into AutoParamDataSource: |
you are right, we should be actually using |
I tried something like this
But it is extremely ugly (and probably slow), and actually doesn't work, because we can't get camera info before this frame. |
@Altren check these forum threads, perhaps they will be helpful to you: |
@sercero @paroj Thank you for the help making it all better. |
Fixed in master |
And even after doing all this changes OpenGL platforms complain about shaders every frame:
|
@Altren see if you can check with this program the OpenGL function calls. I am checking it on my side |
fixed in OGRECave/ogre@d06daf6 |
Hello @Altren,
I don't expect you to merge this pull request but I want you to review the code since I am having some problems that I am unable to solve:
The good thing is that thanks to the changes made by @paroj these issues got fixed:
I will try to keep working on these problems, especially UnitTest_RTTLayer not working since at some point it did work...
However I am getting very frustrated with this and need to do something else for the moment.
Best regards,
Guillermo