Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Doc Block
Apr 15, 2003
Fun Shoe
They’re “together” because of legacy reasons (Depth24Stencil8 hardware formats), but people use 32-bit float depth buffers now with stencil existing in a separate texture and so it’s just done for convenience.

Anyway, the stencil test happens at the rasterization stage, so instead try to use scissor rects or a smaller viewport, so that geometry in those parts of the screen will just get clipped instead (skipping rasterization entirely).

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
The error message is explicitly saying it can’t be signed because you don’t have a team specified, and in your screenshots you don’t have a team or bundle specified.

Also, shipping it with your app as a framework instead of a dylib is probably gonna be the path of least resistance in the long run.

Doc Block fucked around with this message at 19:42 on Dec 3, 2020

Doc Block
Apr 15, 2003
Fun Shoe
Ohhh... that's what I get for phoneposting :haw:

edit: I would probably just make a new Framework target, and add files to it however you need them. Then you can have your app use that instead of the dylib and no custom include directories or any of that.

Doc Block fucked around with this message at 21:56 on Dec 3, 2020

Doc Block
Apr 15, 2003
Fun Shoe
Generally, what I do is:

1)build the framework
2)in Finder, copy it to the same folder as YourProject.xcodeproj
3)in the build stuff for your project, under the General tab, in the Frameworks, Libraries, and Embedded Content section, hit the +, hit Add Other..., and select the framework (make sure to select the one you copied to the same folder as your .xcodeproj).
4)Xcode should do the rest. Make sure you undo any custom include directory stuff in the build settings.

edit: as to Carthage, I don't use it so I have no idea what it's doing differently. AFAIK it's just a package manager that sets up an Xcode workspace for you with your app's dependencies' .xcodeproj included and set as a dependency for your app, right? I've never really bothered with Xcode workspaces.

Doc Block fucked around with this message at 23:53 on Dec 3, 2020

Doc Block
Apr 15, 2003
Fun Shoe
the iPhone 11 and 12 back facing cameras each have a 12 megapixel resolution, according to Apple. This works out to 4K (4096 x 3072 = 12582912 pixels, aka 12 megapixels).

Doesn’t mean that’s the raw pixel dimensions though

Doc Block fucked around with this message at 04:09 on Dec 15, 2020

Doc Block
Apr 15, 2003
Fun Shoe
So that sprite is just a texture? How are you drawing it? etc. etc. etc.

There's a lot of stuff it could be, depending on how you're doing the drawing.

It could also be a bug in SpriteKit.

Doc Block
Apr 15, 2003
Fun Shoe
It looks like a clipping problem, so I would make sure your code that figures out the size of the sprite, its position, and whether or not it's on screen is actually doing what you think it does.

Is there a reason you have the max X and Y values set to be the center of the frame? What is the anchor point of each sprite?

Where is node.minX and friends coming from in isOffscreen()? The docs don't show SKSpriteNode or SKNode having those.

Doc Block
Apr 15, 2003
Fun Shoe
Haven’t worked on a new app in a while, but isn’t the idiomatic way to either
A)stuff it in your AppDelegate
B)make your own singleton and put it in there

Doc Block
Apr 15, 2003
Fun Shoe
Weird that SpriteKit does that instead of just using Z as the draw sorting order like other 2D engines do.

Doc Block
Apr 15, 2003
Fun Shoe

awesomeolion posted:

My guess is that there's some Spritekit bug related to figuring out a reasonable drawing order when sprites on the same z position.

If there’s any sanity to SpriteKit’s implementation, z position is just used for sorting. It’s not like they’re enabling depth testing and you’re getting z-fighting problems. Two objects having the same Z value shouldn’t have any effect; the second one should just get drawn on top of the first.

quote:

I've now run full speed into the next issue... spawning obstacles on a timer and dropping my frame rate from 60 to 8 to freezing. So far my impression of going from Unity to SpriteKit is that it's very foot-gun-y. Which I guess makes sense because Unity is pretty idiot-proof. Anyways, something to debug next time!

Adding and removing nodes constantly is going to be slow, especially if you’re also doing a bunch of your own initialization stuff. The worst case is that SpriteKit has to allocate memory for a new node array, copy everything over, and then re-sort it by Z value.

Keep a handful of “dead” objects around and parented to your scene, but either hidden or positioned offscreen, then when you need a new one use one of those, and when removing an object make it one of the dead objects.

Or, if you’re adding all objects as direct children of the scene, instead break your scene apart into layers. Use a separate SKNode for each layer of your scene, and add/remove objects from those, which will limit the amount of work SpriteKit has to do when adding/removing objects to that particular SKNode instead of having to re-sort the whole scene.

Doc Block
Apr 15, 2003
Fun Shoe
Maybe something like this

You’ll have to work out the vertices of your rectangle and transform them based on its rotation, but that’s pretty easy, especially in 2D (I believe Core Graphics has functions for translating and rotating 2D points that you could use).

You could also bring in SpriteKit’s physics engine, but that’s kind of overkill for such a simple case, especially if all you want is to know if two shapes overlap and don’t need all the bouncy physics results.

Doc Block fucked around with this message at 15:54 on May 10, 2021

Doc Block
Apr 15, 2003
Fun Shoe
https://metalbyexample.com is how I learned, but the dude has for some weird reason gone back and changed some of the older articles and their code samples and they no longer compile as-is (he removed some stuff that used to be in them)

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
The Metal Shading Language from Apple

Also try Metal by Example

Also Apple’s Metal sample code.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply