Jump to content

Autosprite2 in shader distorts image?


Botdra

Recommended Posts

Posted

I'm trying to get a 2D sprite image to maintain it's direction, facing the player at all times no matter where they are. I know I can use "deformVertexes autosprite" for this in a shader, but that rotates the sprite in all directions. I only want it to rotate around a single axis, which autosprite2 does. The problem is that autosprite2 distorts the texture, resulting in bent, angled, or twisted sprites.

Anyone know a fix for this?

Posted
38 minutes ago, NAB622 said:

Autosprite2 works across the longest axis of a surface . Try making your surface rectangular instead of square.

It is, I'm using a rectangular brush. Texture looks the way it should in radiant, but then in-game it ends up being distorted.

Posted
On 9/27/2023 at 12:13 AM, NAB622 said:

Ah, sorry, I misunderstood your issue then. Can you post a screenshot?

Here's what my brush looks like in radiant, versus how it shows up in-game using Autosprite2:

Screenshot2023-09-28110253.png.d875bdc10c5b5d758a681dff4d0bc427.pngshot2023-09-28_11-05-10.jpg.5743eb38a4694c10bc103b48c19d6856.jpg

Now, for some reason, if I set it to Autosprite the texture just adjusts itself to a square shape, which is equally frustrating. But I'm mainly looking for Autosprite2 to work, as that's the single-axis rotation I'm looking for.

shot2023-09-28_11-05-49.jpg.c8dda3206c18fa65f0c63121b633ac8d.jpg

Posted

After thinking about it for a bit, what does the wireframe on that brush look like? Maybe it has a bunch of invalid faces. That could certainly cause issues.

Posted
50 minutes ago, NAB622 said:

After thinking about it for a bit, what does the wireframe on that brush look like? Maybe it has a bunch of invalid faces. That could certainly cause issues.

This is what I get in-game. Notice how it's missing a line on the right side, but has an X pattern through the middle?  Meanwhile, if I simply remove the Autosprite line altogether, it shows a wireframe that's a full square with only one diagonal line, no X.

Screenshot 2023-09-28 143134.png

Smoo likes this
Posted

Okay, yeah, you'll definitely want to remake that brush. Don't do any vertex edits, make sure there's no chance of the game getting confused.

 

Now..... In my opinion, autosprite2 isn't even a great idea here. The candle is large enough that you should seriously consider creating it out of geometry, with either a 12 sided brush or a patch mesh. Use autosprite2 for the flame at the top.

 

In both cases, if you are using brushes be sure to also mark them as detail (Ctrl + M), that should discourage the geometry splits on each face.

Posted
4 hours ago, NAB622 said:

Okay, yeah, you'll definitely want to remake that brush. Don't do any vertex edits, make sure there's no chance of the game getting confused.

 

Now..... In my opinion, autosprite2 isn't even a great idea here. The candle is large enough that you should seriously consider creating it out of geometry, with either a 12 sided brush or a patch mesh. Use autosprite2 for the flame at the top.

 

In both cases, if you are using brushes be sure to also mark them as detail (Ctrl + M), that should discourage the geometry splits on each face.

I didn't touch the vertexes at all. I just made a normal brush, no adjustments. What you're seeing is just the difference between a normal brush, and adding Autosprite2 to the shader file. Doesn't matter how many times I remake a brush, or what texture it's used with.

I'm just using the candle as an example for now, I'm using autosprite2 on elements that would be way too high poly for brushwork, and too much work to make into models.

I made it a detail brush, no luck unfortunately.

Posted

That's really strange. I get the feeling something else is at play here.

The only way I can try to help further is to see the .map file and the shader file. Sorry I haven't been much help on this one.

Posted
12 minutes ago, NAB622 said:

That's really strange. I get the feeling something else is at play here.

The only way I can try to help further is to see the .map file and the shader file. Sorry I haven't been much help on this one.

Oddly enough, it doesn't matter what map, texture, or shader file I use. I think it's just the nature of Autosprite2, considering I have yet to find an example of it in use in any map.

Posted

Autosprite2 is mostly used for energy beams and effects-style stuff. In the single player campaign, I believe the chains on Korriban use it.

I've used it in several of my own creations, too. Taspir Power Complex v3 uses it on the CTF map. There are small vertical energy beams surrounding the flags for each team. Don't know if I ever released the source files for that, though...

  • 1 month later...
Posted

You must make sure for autoSprite2 shaders - that you DO NOT compile your -bsp phase with -maxarea switch enabled. It WILL destroy the effect.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...