Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dajuice

Pages: 1 2 [3]
31
Support / Sprites, Atlases and memory management
« on: March 01, 2013, 02:06:36 pm »
I'll start off by telling you I'd find it normal and not rude at all if you don't answer this but since I don't know where to begin, I'm taking as many paths as possible to get my answers.

I've been making my first unity game for almost 5 months now and you did a great job guiding me through hardships, thanks.
But now I've discovered that (on IOS at least) the profiler is completely irrelevant, or that I'm doing something very wrong, I'm asking you this to make sure I'm not doing something wrong.
The game we're making is really texture heavy (we have over 30 jam packed atlases, most of 'em 1024x1024), at the title screen, the unity profiler tells me it uses about 20MB, the Instruments profiler tells me 90MB. What I understand from that, is that the unity profiler hides the textures that are currently used but not on screen from the memory profiler. This means that the unity profiler tells me that only the title screen is in memory and my other textures are somehow compressed, ready to be used, but in fact my whole UI is loaded with all it's textures fully uncompressed.

So this is it, is there some mojo I must do in order to make the iOS behave just as the unity profiler tells me it behaves, or must I manually manage all those atlases?

32
Support / Re: Premultiplied white shader?
« on: February 22, 2013, 01:39:28 pm »
Thanks for the reply, I guess if I have to split the outline from the core, I'll just make a white version of the images and play with the alpha.

33
Support / Premultiplied white shader?
« on: February 20, 2013, 03:44:48 pm »
Hi!
Well, I already asked for a shader that flashes white, this saved my life, thank you! But now I got to make something with a white outline flash... I tried the same approach on premultiplied vertex color shader, it didn't quite give the expected result, tried some variants, did nothing good... How do you do it?

Once again, thanks!

34
Support / Accessing Commit command of a sprite collection?
« on: February 19, 2013, 06:03:13 pm »
Hi,
Since I've been messing around and rearranging my atlases many times for optimisation sake and as the scope of the game grows, I made a script that changes the sprite's Collection while keeping it's graphism, providing the image is in both, the source and target collection. Everything works fine but I can't get the sprite collection to commit the changes (to the collection data) automatically, which could lead to some unwanted effects if one forgets to do this. Any way to force or access the commit or Rebuild functions of the collections?

Thanks.

35
Support / Re: Changing the color of a mesh using tk2d shaders
« on: January 29, 2013, 11:09:33 pm »
using UnityEngine;
using System.Collections;

public class ShadowOnVaVoir : MonoBehaviour {
   Color[] colors;
   Color myColor;
   void Awake() {
      myColor = new Color(0, 0, 0, 0.5f);
      Color[] colorsBegin = GetComponent<MeshFilter>().sharedMesh.colors;
      colors = new Color[colorsBegin.Length];
      GetComponent<MeshFilter>().sharedMesh.colors = colors;
      Debug.Log("yo");
      Update();
   }

   void Update() {
      renderer.material.SetColor("Color", myColor);
      renderer.material.color = myColor;
      int i = colors.Length;
      while (i-- > 0) {
         colors = myColor;
      }
      GetComponent<MeshFilter>().sharedMesh.colors = colors;
      Debug.Log("hey");
   }
}
... doesn't work, well I think I'll forget about it, it works on other shaders, it works with non RenderTextures, but there is no way to make it work for what I need ?L?.

36
Support / Changing the color of a mesh using tk2d shaders
« on: January 29, 2013, 10:39:11 pm »
Hi there... beginning to be a little shy to take up all this time of yours, but I'm completely stuck.

I need to use one of your shaders on something that is not tk2d, then I need to change the color (trying to make some shadows...), I spelunked in your scripts and I think I found how you changed your colors, but then it does not seem to work. (it works with other shaders though)

here is the script (keep in mind it is testing script
Code: [Select]
using UnityEngine;
using System.Collections;

public class ShadowOnVaVoir : MonoBehaviour {
Color[] colors;
Color myColor;
void Awake() {
myColor = new Color(0, 0, 0, 0.5f);
Color[] colorsBegin = GetComponent<MeshFilter>().sharedMesh.colors;
colors = new Color[colorsBegin.Length];
GetComponent<MeshFilter>().sharedMesh.colors = colors;
}

void Update() {
renderer.material.SetColor("Color", myColor);
renderer.material.color = myColor;
int i = colors.Length;
while (i-->0) {
colors[i] = myColor;
}
}
}

As usual, thanks for your time and commitment

37
Support / Re: Changing spriteId on runtime, bug while rotating?
« on: November 28, 2012, 02:44:07 pm »
I'm changing spriteId with sprite.spriteId = int newSpriteIdVar.
The timeline I'm talking about is one I've made, but the thing is if I don't change the spriteId, it works well, if I put my sprite inside the gameObject that will be controlled by the timeline instead, it works well, but when I try to control the sprite and change the spriteId, it becomes offset, I see it when I change the spriteId, the sprite don't have the good rotation as if it was resetting, but the rotation value on the transform is good. As I said earlier, it happens on only one of both wings, the other is good... maybe I could send you the project so you can further investigate on this? On my side I consider it fixed (patched would be a more accurate term) but maybe it could help you?

38
Support / Re: Changing spriteId on runtime, bug while rotating?
« on: November 27, 2012, 08:18:11 pm »
One more thing: it seems that if I put the sprites inside a container, it all works well and the said "bug" was only happening on one of the two wings.

39
Support / Changing spriteId on runtime, bug while rotating?
« on: November 27, 2012, 08:05:34 pm »
Hi there, I was messing around with my timeline class when all of a sudden the wings of my monsters started to look really silly. After some investigation, I realized that they began to have a weird rotation when my wings were flashing, the flashing is a baked flash, so they switch to a lighted version of the image and return to their original graph and so on for an amount of time. So I figured that it is when I change SpriteId that the rotation is somehow resetted or altered.

Something I should make clear is that the rotation/position values of the offset sprite shown in the inspector (and the parent's rotation/position) are the same as a non-offset sprite, but visually, their rotation is clearly not the same, even stranger is if I manually set the rotation of the offset sprite, visually, their rotation becomes the same.

I don't know if you could help me sort this out?
thanks.

40
Support / Re: Sprite ID performance vs Animated Sprites?
« on: November 23, 2012, 06:05:41 pm »
Thanks for the quick reply!

41
Support / Sprite ID performance vs Animated Sprites?
« on: November 23, 2012, 05:07:04 pm »
Hello, I have a game that has several static sprites which change stance from time to time, nothing needing an actual timeline, they just switch between 2 static images when prompted to. Is it more optimized CPU and memry wise to just switch sprite ID in this case?

42
Showcase / Re: Wrestle Jump - A two player game on a single iPad/iPhone
« on: November 09, 2012, 07:30:36 pm »
haha, I love it! Shown it to my colleagues and it became a hit, lovely and funny design!  I am wondering, how did you manage to do those outlines? Are they heavy to process?

43
Support / Re: Overlay a color completely? -Performance cost?
« on: November 08, 2012, 05:43:47 pm »
Thanks for the feedback! I did some testing and your additive shader looks to be similar to the new solution you gave in term of performance, maybe an overall gain of 1 frame on 50 fps, yet again this "gain" is too low to determine if it is really attributable to the new shader.

44
Support / Overlay a color completely? -Performance cost?
« on: November 01, 2012, 08:30:13 pm »
In this topic
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,118.msg311.html#msg311

you propose a shader I imagine you made for the guy, nice! But when I wanted to use it in my game so I changed every shader for this, changed some parts of the shader so I could have black as well as white shades of my sprites, then I tried all that on the iPad1... the framerate was around 30fps (the game is supposed to run at 60fps, it is a really basic game). The part I changed to do this was:

Code: [Select]
SetTexture [_MainTex] { combine texture+primary, texture * primary}to
Code: [Select]
SetTexture [_MainTex] { combine texture+-primary}
SetTexture [_MainTex] { combine previous+-primary, texture * primary}

Then I figured that settings a texture twice would be rather GPU intensive so I reverted to the original version, but it was only slightly better, setting all the materials to the original shader gave me a steady 60fps.

I only have one element to flash to white so this is not so much of an issue for me right now, but I'm planning to make a game that will hold many more blinking elements on screen, do you have any idea as to why the shader is so much heavier and if there could be another way/shader to achieve white blinking?

Pages: 1 2 [3]