Jump to content

Dissolve shader problem


Go to solution Solved by havenphillip,

Recommended Posts

Posted

I'm using a dissolve shader by Shadmar, but my character is completely glowing red. What am I doing wrong? Even when I change the color of the dissolving, the texture of the character remains red.

20230222181047_1.jpg

Posted

Is it red in the Material Editor? If so it could be your normals alpha channel.

Edit: I just saw the picture it looks like it is. The first thing I would do is check your fragData1 lines in the Fragment shader. They should look like:

    //Normals Output
    fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a);
    fragData1.a = 1/255.0;

Posted
On 2/23/2023 at 12:44 AM, havenphillip said:

Is it red in the Material Editor? If so it could be your normals alpha channel.

Edit: I just saw the picture it looks like it is. The first thing I would do is check your fragData1 lines in the Fragment shader. They should look like:

    //Normals Output
    fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a);
    fragData1.a = 1/255.0;

It didn't help.

Posted
On 2/23/2023 at 12:44 AM, havenphillip said:

Is it red in the Material Editor? If so it could be your normals alpha channel.

Edit: I just saw the picture it looks like it is. The first thing I would do is check your fragData1 lines in the Fragment shader. They should look like:

    //Normals Output
    fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a);
    fragData1.a = 1/255.0;

If I change the specular map to completely black, the red color  disappears, but the character stops responding to the lighting.
image.thumb.png.9de5ce511145f7ec75493664bd45c132.png

 

20230224182412_1.jpg

Posted

I'm snowed in I have limited power/internet. I'll get back to you on it but it looks like the specular affects it because he made the specular channel and the normals alpha channel the same. I tend to think Shadmar knows what he's doing and I'm not sure why he did it this way but I'm sure the fix will be pretty easy.

  • Solution
Posted

You can try changing the bottom of the shader like this. This works in the material editor for me.

 

#if BFN_ENABLED==1
    //Best-fit normals
    fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z)));
    fragData1.a = fragData0.a;
#else
    //Low-res normals
    fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a);
#endif
    int materialflags=1;
    if (ex_selectionstate>0.0) materialflags += 2;
    fragData1.a = materialflags/255.0;

 

    float specular = color_specular.r * 0.299 + color_specular.g * 0.587 + color_specular.b * 0.114;

    fragData2 = vec4(0.0,0.0,0.0,specular);

    vec3 dissolve_col = vec3(0,1,0);
    if (NoiseV<InvAlpha+0.03) fragData2 = vec4(dissolve_col,specular);

}

 

  • Thanks 1
Posted
10 hours ago, havenphillip said:

You can try changing the bottom of the shader like this. This works in the material editor for me.

 

#if BFN_ENABLED==1
    //Best-fit normals
    fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z)));
    fragData1.a = fragData0.a;
#else
    //Low-res normals
    fragData1 = vec4(normalize(normal)*0.5+0.5,fragData0.a);
#endif
    int materialflags=1;
    if (ex_selectionstate>0.0) materialflags += 2;
    fragData1.a = materialflags/255.0;

    float specular = color_specular.r * 0.299 + color_specular.g * 0.587 + color_specular.b * 0.114;

    fragData2 = vec4(0.0,0.0,0.0,specular);

    vec3 dissolve_col = vec3(0,1,0);
    if (NoiseV<InvAlpha+0.03) fragData2 = vec4(dissolve_col,specular);

}

Partially helped, thanks. Alternatively, I can include this material directly after the character's death.
image.thumb.png.660a52c64a64db22b25957944332a3a1.png

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...