Botdra Posted September 26, 2023 Posted September 26, 2023 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?
NAB622 Posted September 26, 2023 Posted September 26, 2023 Autosprite2 works across the longest axis of a surface . Try making your surface rectangular instead of square.
Botdra Posted September 26, 2023 Author Posted September 26, 2023 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.
NAB622 Posted September 27, 2023 Posted September 27, 2023 Ah, sorry, I misunderstood your issue then. Can you post a screenshot?
Botdra Posted September 28, 2023 Author Posted September 28, 2023 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: 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.
NAB622 Posted September 28, 2023 Posted September 28, 2023 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.
Botdra Posted September 28, 2023 Author Posted September 28, 2023 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. Smoo likes this
NAB622 Posted September 28, 2023 Posted September 28, 2023 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.
Botdra Posted September 29, 2023 Author Posted September 29, 2023 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.
NAB622 Posted September 29, 2023 Posted September 29, 2023 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.
Botdra Posted September 29, 2023 Author Posted September 29, 2023 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.
NAB622 Posted October 1, 2023 Posted October 1, 2023 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...
mjt Posted November 13, 2023 Posted November 13, 2023 You must make sure for autoSprite2 shaders - that you DO NOT compile your -bsp phase with -maxarea switch enabled. It WILL destroy the effect.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now