I had a previously working copy texture call that has suddenly stopped working properly (for reference I am using a slightly modified version of Spine2Ds "Sprite Attacher" that copies textures to the spine). There were no code or texture format changes it just seemed to stop working one day and even the examples from Spine stopped working (I am using the latest version of Spine).
This was the code that used to work:
Graphics.CopyTexture(source, 0, 0, (int)sourceRect.x, (int)sourceRect.y, (int)sourceRect.width, (int)sourceRect.height, destination, 0, 0, 0, 0);
Here are watch values for the above line:
The problem is it now renders copied textures as either a grey box, or, sometimes 1/4 (always the bottom left) is rendered and the other 3 quarters are rendered as grey.
For reference here is my code trying to run the copy texture code and heres how it appears
As you can see the bottom left is rendering but the other 3 quarters are missing. For reference I am using Spine2D and even using their example scenes whenever it does a copytexture call, those textures also appear as grey.
I am a novice when it comes to GPU related bugs but if you have any suggestions on how I can debug this I am all ears. I tried changing the texture formats (both original and destination) but it didn't work out well. I can't easily go back in my git history either because there are incompatible frameworks with the unity versions so I need to solve this as it is now but I can safely say there were no local code changes that caused this isssue.
Any and all suggestions on how to debug/fix this are welcome.
It was a spine bug and it will be fixed
Related
I have several 8x8 tiles and an SKTileSet .sks file with the tiles in it. The tile size is correctly set to 8x8. The tiles are also in the .xcassets catalog. The tiles correctly display clearly and with sharp edges, just like when you use NearestNeighbor rescaling.
The issue comes after saving the project. The tiles still work fine, but if I try to add a new tile to the tile set, all of the tiles before the save become blurry. I was expecting them to not be affected and continue displaying just like they were before saving.
I have tried many things:
Updating mac version and Xcode version (macOS 13.2, Xcode v14.2)
Reinstall Xcode
Make different projects to see if issue persists(it does)
Tinkered with numerous settings in build target as well as in Xcode itself
First, My goal is render sprite objects as below.
So, I set Edit>Project Settings>Graphics>Transparency Sort Mode as "Custom Axis" and Transparency Sort Axis as (0,1,0).
But it only works in the Scene View. When I run play mode, the Transparency Sort Axis I set automatically return to the default value - I mean, Custom Axis + (0.49,-1,0.49). Then the objects' states in the play mode are as below.
I've been suffering from this problem over than a week... because as far as I remember, when I was much more unskilled Unity beginer and tried some tutorials, the setting I set in this way worked in the play mode without any issues.
I think maybe the reason is in the asset I imported because when I made a new project without any asset and tried exactly same procedures, it worked.(transparency sort axis didn't changed automatically during play mode). But I'm still not sure about this problem's reason yet and don't know how to fix it.
Could you please help me solve this problem?
I imported a PNG of all of the textures I want to use in a mobile game and when I went into the sprite editor, I noticed that the edges of the sprites were "fading" into the transparent background - and the transparency changes throughout this "fade". Autodesk Sketchbook does something similar when I open the image in it, but GIMP, MS Paint, and Windows Photos don't. I was going to put pictures of what I'm talking about here, but Stack Overflow says I'm not allowed to yet. How can I fix the problem? Is there a setting in Unity that I can change so it doesn't add the "fade" or do I have to change the file format and import it again?
EDIT: I have created an Imgur album with pictures of my problem. Basically, Unity is blending the colors of the sprites and it's blending the alpha too. Also, I made the textures bigger at one point and that improved the problem, but didn't fix it completely. Here are the pictures: https://imgur.com/a/6HGm3fy
EDIT #2: First off, someone commented trying to explain what I was seeing in my imgur pictures and I asked how to fix the problem he was describing without realizing that you can't properly reply to comments, so I'm asking again, how can I fix it? Second, I just tried messing with anti-aliasing in the quality settings of my project and got this error: "Setting anti-aliasing of already created render texture is not supported!" I didn't think I had any render textures - just regular textures - but when I double-clicked the error, an unnamed render texture with an illegal size (55x110 pixels) showed up in my inspector. Changing its settings doesn't seem to do anything, but in the inspector, it still looks like it was changed. What am I seeing?
I am creating a game (it's actually more of an application/useful software than a game) which needs to be run on multiple monitors, where all monitors are potentially different resolutions.
In the example below, you can see the primary monitor (far left) rendering a full screen camera view, just as it should. There are two other cameras set to render to monitor 2 and 3. These are activated with Display.displays [1].Activate (1600, 900, 50); (so as to set their resolutions to 1600x900).
The issue is that Unity appears to be offsetting the camera rendering so that it does not originate from the top left of the screen, but rather some way down the window. The grey area shows the area where the image is missing.
When running in the editor, the cameras render each window perfectly with no strange offsetting/cropping.
What do I need to do in order to get the standalone output to render the correct, uncropped/offset image in each of the windows, please?
If I make the resolution of all monitors the same, it renders exactly as it should do:
Annoyingly, this seems to be a bug with Unity version 5.3.x. It seems to be fixed in 5.4.x [See Bug Report Here] (I have downloaded the beta and tested it - I can confirm this to be true!). However, 5.4.x is currently in beta and you can only access it if you have Unity Pro.
So I am using Xcode 3.2.1 and am trying to make an iPhone OpenGL ES1 project. The default template for an opengl project is ok, but I have been trying to split the code up so not everything is done per frame on the drawView() call.
I have a seperate setupRC method that sets the lighting, turns on depth test, turns on culling and sets the clear color. This is called on the init of the EAGLView and this works just fine.
I have took the glViewport() and glFrustrum() calls and put them at the end of the resizeFromLayer() method in the ES1Renderer.m file. This gets hit when the app starts and when the app gets resized as it should.
Now the problem is the frustrum's far seems to be messed up, as in all my objects get cut / clipped off. I tried adjusting the camera position and angle and it still all objects are cut / clipped. I increased the far from 1000.0f to 30000.0f and still get the same result. What is crazy is that if i call both the glViewport() and glFrustrum() calls in the drawView() every frame everything looks right. Nothing is clipped and looks like i want it. From everything I've been reading the frustrum and viewport calls only need to be called when the window / gets made and resizes, but If I don't call it every frame in my project it doesn't work. Any ideas?
Thanks In Advance
I wonder if you might be doing some extra translating somewhere before you start drawing? Maybe you could make sure you do a loadIdentity() before you start drawing everything just to make sure you're starting from where you think you are.
In trying to get this frustum/viewport situation worked out in XCode's OpenGL iphone template myself, one resource that was helpful in getting to the bottom of it was:
http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html