Giter VIP home page Giter VIP logo

Comments (6)

jekyllgrim avatar jekyllgrim commented on August 18, 2024

Replied in Discord, will reply here in the inerest of completeness: actor scaling can be approximated with the formula texture size * actor scale * 2. But without separate X/Y sizing adding a whole flag for this doesn't strike me as particularly necessary.

Example:

class pptest : DoomImpBall
{
    Default
    {
        scale 0.34822; //use any weird scale
    }
    override void Tick()
    {
        Super.Tick();
        if (isFrozen()) return;
        FSpawnParticleParams p;
        TextureID tex = curstate.GetSpriteTexture(0);
        if (!tex || !tex.IsValid()) return;
        p.size = TexMan.GetSize(tex) * scale.x * 2;
        p.style = GetRenderstyle();
        p.color1 = "";
        p.texture = tex;
        p.flags = SPF_ROLL;
        p.startroll = 180;
        p.startalpha = 1.0;
        p.lifetime = 35;
        p.fadestep = -1;
        p.pos = pos;
        Level.SpawnParticle(p);
    }
}```

from gzdoom.

MajorCooke avatar MajorCooke commented on August 18, 2024

That doesn't work appropriately. I tried a variety of things but couldn't get it to match. Even copying your code directly.

from gzdoom.

madame-rachelle avatar madame-rachelle commented on August 18, 2024

The particles are slightly shrunk. Also GZDoom seems to force actors to be 1 or 2 texels wider than the particle renderer does, for some odd reason. Not sure why or how that works, I can only speak for the scaling that I added to try and make particles approximately close to the same size that they were before they were turned into true squares.

This was the math to shrink it: scalefac *= 2 * ps / (ps * ps + 1); - all that needs to be done is to reverse that. Essentially with default scaling it is multiplying by (2.4 / 2.44). These values could be subject to change, however.

from gzdoom.

MajorCooke avatar MajorCooke commented on August 18, 2024

Huh. Alright then I'll give that a try.

from gzdoom.

madame-rachelle avatar madame-rachelle commented on August 18, 2024

I think it's worth noting - for VisualThinkers and Actors, if you activate the +ROLL flag on either of those, they will use the same math to shrink themselves down to the square pixel ratio also. Again, it was to try and make them appear to be somewhat the same size that they were, even if they got a little stretched on the X axis to accommodate the change. So if you want your actors to be the same size, activating the +ROLL will instantly do that. But keep in mind what I said before - Actors, for some reason, do still expand themselves out by a texel or two.

from gzdoom.

MajorCooke avatar MajorCooke commented on August 18, 2024

Jekyll suggested a flag to change that so that stretching behavior can be toggled for particles. That sounds like a wise idea to include.

from gzdoom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.