Jump to content

Dissolve shader problem


Ghost
 Share

Go to solution Solved by havenphillip,

Recommended Posts

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;

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Solution

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...