Can you interpret this result for me

 for (int i = 0; i < PARTICLE_NUMBER; i++)
      {
          X = PARTICLES[i].x + Random.Range(MOVE_DIRECTION.x, MOVE_DIRECTION_MAX.x);
          Y = PARTICLES[i].y + Random.Range(MOVE_DIRECTION.y, MOVE_DIRECTION_MAX.y);
           if (Y < -280)
            Y = 280;
           if (X < -500)
            X = 500;
           PARTICLES[i] = new Rect(X, Y, RECT_SIZE.x, RECT_SIZE.y);
        }

8992345--1238263--egz.gif
20fps gif.

new particles never spawn they just recycle on the screen when below point as the code says. But they pop up from zero, center screen. I know as far as center screen is 0,0 but at no point do they come back up near center yet you can see that they do.

8992345--1238272--gf3.gif

Is it possible that you have multiple cameras in your scene? It’s really hard to tell since we don’t even know what kind of particles you’re talking about. Since you only check for the negative border in X and Y we would assume that the particles always move in the negative direction? So your “MOVE_DIRECTION” and “MOVE_DIRECTION_MAX” are both negative? If not your code doesn’t make much sense. However if the particles always move towards the diagonal negative (bottom left), those that actually move to the top left may just be the same particles just viewed with a second camera from a different point.

1 Like

Sorry for the hard question.

No second camera in the scene.

It is in the editor though. So I wonder maybe if some misunderstanding is happening between screen sizes. I put some values in there that corresponded to approximately editor sized. But the actual res I was on is 1280 720 It’s suppose to give me the canvas from 0 bottom left I believe with those values, and then I could use that for the lowest point reference. But yeah I don’t know either lol but I didn’t want to stay up all night tonight working with it. I think it might be editor window aspect related.

They even clip from the point of the screen as if the aspect had sliced them off like you say as if a second camera is watching.

Are you sure about that? Cameras could have hideflags set so they don’t show up in the hierarchy. You could try my ancient hidden object browser script I posted over here. I’m not sure if this script still works. A lot has changed in the past 9 years ^^.

Note that there may be hidden objects which belong to the sceneview(s) or other internal stuff. Though it’s worth a shot. Maybe you have some faulty editor code somewhere that has left a camera in the scene?

8993608--1238497--cams.gif

So looks like you don’t need a camera for that type of rendering
look how weird it is.
the left edge of the screen still acts as if a display camera is rendering, while the main screen is set to don’t clear. I messed with aspect ratio closed scene view, but hm. no success i am using Graphics DrawTexture

8993608--1238500--horitztonal.gif

8993608--1238509--aspect2.gif

Why haven’t you said that right in your first post? You talked about particles so everyone would assume you use Unity’s ParticleSystem.

When you draw stuff manually it highly depends on where and when you draw stuff. You CAN NOT use those low level rendering methods in Update. Update executes way too early. With other callbacks like OnGUI for example you have to be careful at which event you’re rendering. As the documentation of Graphics.DrawTexture even warns about you must only draw during the Repaint event.

However at the moment we have no idea what you’re actually doing. The snippets of code you have shown doesn’t seem to be related to your problem at all.

What “type of rendering” are you even talking about? You really should explain your setup in more details. Using low level rendering requires a lot care and knowledge about how the GL rendering context in Unity works. You can not just “render” something at will. There are many factors to account for. So if you expect any further help, you really need to be more precise on what you’re actually doing. Show your “rendering code”. Though not just the rendering code, also where or from where it is called.

Use a particle system. Unity’s low level APIs just add unnecessary complexity.

1 Like

I don’t like the solution but perhaps you are right

Actually for now I disabled it

But, I think it won’t be that way in build so it may be build only test effect hold up il test
…

Yes so the anomalous dual screen GUI position is present after build aswell

Il explore more

private void OnGUI()
    {
        if (Event.current.type.Equals(EventType.Repaint)) // THis is Important!
        {
            for (int i = 0; i < PARTICLES.Count; i++)
            {
                Graphics.DrawTexture(PARTICLES[i], PARTICLE);
            }
        }
    }

I got it.

So the smaller aspect is the correct one :slight_smile: the larger (correct result looking one) was the bug !!
Thanks girls. I hope we all learn the best way to make particle effect O_O

8994121--1238584--fin.gif

as you can see the smaller aspect now takes 0 to screen width and height for correct pix position

8994295--1238602--2048 particles.gif

        Rect R = new Rect(0,0,0,0);
        float X = 0;
        float Y = 0;
        var R1 = Random.Range(MOVE_DIRECTION.x, MOVE_DIRECTION_MAX.x);
        var R2 = Random.Range(MOVE_DIRECTION.y, MOVE_DIRECTION_MAX.y);
        var W = Screen.width;
        var H = Screen.height;
        Rect P;
        for (int i = 0; i < PARTICLE_NUMBER; i++)
        {
            P = PARTICLES[i];
             X = P.x + R1;
             Y = P.y + R2;
            if (X < 0)
                X = W;
            if (Y < 0)
                Y = H;
            R = P;
            R.x = X;
            R.y = Y;
            PARTICLES[i] = R;
        }

2048 particles around 150% more than needed, without lights OnGui render not so bad.

8994295--1238641--ezgif-2-b8939ba3a2.gif
happy days