Particles are rendered incorrectly in mirrors
under review
Frionil Fang
Reflected particles are all kinds of crooked and squished, depending on the camera angle.
Make a basic mirror and try this script in an object in front of the mirror:
default
{
state_entry()
{
llParticleSystem(
[
PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_EXPLODE,
PSYS_PART_BLEND_FUNC_SOURCE,PSYS_PART_BF_SOURCE_ALPHA,
PSYS_PART_BLEND_FUNC_DEST,PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA,
PSYS_PART_START_SCALE,<0.500000,0.500000,0.000000>,
PSYS_SRC_TEXTURE,"b527918b-3658-14be-343f-90df989542ba",
PSYS_PART_MAX_AGE,1,
PSYS_SRC_BURST_RATE,0.1,
PSYS_SRC_BURST_PART_COUNT,1,
PSYS_SRC_BURST_SPEED_MIN,1,
PSYS_SRC_BURST_SPEED_MAX,1,
PSYS_PART_FLAGS,
PSYS_PART_EMISSIVE_MASK |
PSYS_PART_FOLLOW_VELOCITY_MASK |
PSYS_PART_WIND_MASK
]);
}
}
The FOLLOW_VELOCITY setting makes it especially noticeable they are also aligned wrong, not just squished. Ribbon particles appear to be behaving better than standard ones, didn't see any obvious issues on a quick check with them.
Log In
Dan Linden
under review
Dan Linden
Right. Particles are 2D sprites, like a sheet of paper, and are rendered perpendicular to the direction the camera. When viewing the object with particles at a 45° angle the mirror reflection is correct to view the particles edge on, like looking at a sheet of paper edge on.
Frionil Fang
After staring at Dan's picture a little, I realized what's going on: the particles in the mirror are rendered aligned exactly the same as they in the real viewport, which is why ribbons work. It's easier to make the connection by having a single static particle decal thing in view. Sure, it's more realistic to have them exactly mirrored, but particles are not realistic to begin with.
Top part has the mirror at ~45 degrees angle to the view, leaving the particle nearly invisible, middle has it almost parallel.
Dana Enyo
Are you sure that is a real mirror? It sounds like you're describing a reflective PBR surface, the "almost mirrors" we had just before the real thing came out. The ones I made then look exactly the way you describe.
Frionil Fang
Dana Enyo The picture isn't mine, it's Dan Linden's. It's a real mirror though.
Dana Enyo
Frionil Fang OK, Thanks! I'll have to try that too (I've got a lot of PBR experiments in my Flickr.)
Dan Linden