FreshRSS

Normální zobrazení

Jsou dostupné nové články, klikněte pro obnovení stránky.
PředevčíremHlavní kanál
  • ✇Recent Questions - Game Development Stack Exchange
  • Particles not rendering over projectorsidurvesh
    I am using projectors for shadows...When I use particles for bike speed up i.e., nitro speed the particles get cutout by those shadows.... Here is screenshot of it, Here is my shader code of projectors , Shader "Projector/Projector Multiply Black" { Properties { _ShadowTex("Cookie", 2D) = "gray" { TexGen ObjectLinear } _ShadowStrength("Strength",float) = 1 } Subshader { Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+100" } Pas
     

Particles not rendering over projectors

I am using projectors for shadows...When I use particles for bike speed up i.e., nitro speed the particles get cutout by those shadows....

Here is screenshot of it,

enter image description here

Here is my shader code of projectors ,

Shader "Projector/Projector Multiply Black"
{
    Properties
    {
        _ShadowTex("Cookie", 2D) = "gray" { TexGen ObjectLinear }
    _ShadowStrength("Strength",float) = 1
    }

        Subshader
    {
        Tags{ "RenderType" = "Transparent"  "Queue" = "Transparent+100" }
        Pass
    {
        ZWrite Off

        //Fog { Mode Off }

        Blend DstColor Zero

        CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_fog_exp2
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"


        struct v2f
    {
        float4 pos : SV_POSITION;
        float2 uv_Main     : TEXCOORD0;
    };

    sampler2D _ShadowTex;
    float4x4 unity_Projector;
    float _ShadowStrength;

    v2f vert(appdata_tan v)
    {
        v2f o;


        o.pos = mul(UNITY_MATRIX_MVP, v.vertex);

        o.uv_Main = mul(unity_Projector, v.vertex).xy;


        return o;
    }

    half4 frag(v2f i) : COLOR
    {
        half4 tex = tex2D(_ShadowTex, i.uv_Main);
        half strength = (1 - tex.a*_ShadowStrength);
        tex = (strength,strength,strength,strength);
        return tex;
    }
        ENDCG

    }
    }
}

Here is my particle code,

// Simple additive particle shader.

Shader "Custom/Particle additive"
{
Properties
{
    _MainTexture ("Particle Texture (Alpha8)", 2D) = "white" {}
}

Category
{
    Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
    Blend SrcAlpha One
    Cull Off Lighting Off ZWrite Off Fog {Color (0,0,0,0)}

    BindChannels
    {
        Bind "Color", color
        Bind "Vertex", vertex
        Bind "TexCoord", texcoord
    }

    SubShader
    {
        Pass
        {
            SetTexture [_MainTexture]
            {
                combine primary, texture * primary
            }
        }
    }
}
}
  • ✇Recent Questions - Game Development Stack Exchange
  • How to modify a prefab Explosion effect with your own particle sprite?ihatec
    My main goal is to create an explosion effect when I clicked the object. Therefore, I searched in Unity Assets, and found a cool framework called CartoonFX, which is really ok for me. Cartoon FX - Unity Store I am using prefab -> CFXR4 Firework 1 Cyan-Purple. However, the particles scattered around are default particles, they are provided by framework itself. I want to change them with my own particle sprites. Therefore, the explosion will look more realistic, as the object itself is really e
     

How to modify a prefab Explosion effect with your own particle sprite?

My main goal is to create an explosion effect when I clicked the object. Therefore, I searched in Unity Assets, and found a cool framework called CartoonFX, which is really ok for me. Cartoon FX - Unity Store

I am using prefab -> CFXR4 Firework 1 Cyan-Purple. However, the particles scattered around are default particles, they are provided by framework itself. I want to change them with my own particle sprites. Therefore, the explosion will look more realistic, as the object itself is really exploding.

What I tried?

  1. I opened the prefab, and its particle effect system. In there, I enabled Texture Sheet Animation, change the mode to "Sprite" from "Grid". I did not add a sprite here, because I want to add the particle sprite in the script itself, since an object could be different types, like Red, Blue etc.
  2. I tried to use Claude for that, because I could not write it myself. I am sorry but I just needed to see a working prototype, then I could fix it later. However, it only gave me unvalid code pieces (like there are no attributes of ParticleSystem that Claude claims).

I already have a particle sprite, that I load it on the script, called particleSprites, a Sprite array. However, I could not change the default particle sprite of the explosion prefab to my particle. I am not very familiar with ParticleSystem and framework itself, so I could not guess what to do at this point. I want to keep all of the other things same (how particles scatter around, how they move etc.), but only change the particle sprite element.

If you can help me, or show me a way, or a resource, I would be glad! This type of things really takes so much time, and I am really searching for it for a while. Other than that, I can understand the code part itself, its OK. Thanks in advance, love you guys.

Rotating certain particles in a particle system in Unity

I'm working on a visual effect using particle systems.

I'm trying to rotate newly created particles according to some object's velocity at that time.

Currently, I'm rotating the entire particle system and I use the "Align To Direction" option in the "Shape" options.

It works fine, until I change the velocity of the object - then it rotates every existing particle too.

How can I rotate particles when they are created?

❌
❌