#Custom Material Help! How do you not render entities behind it?

1 messages · Page 1 of 1 (latest)

dim girder
#

Custom Material Help! How do you not render entities behind it?

I am attempting to learn how to go about doing this, I have attempted removing DisableCulling

My current material looks like this.

"hide_entities:entity_alphablend": {
          "-states": [ "DisableCulling"],
          "+states": ["DisableDepthWrite"]
}

Currently it renders entities behind it, how do you disable this, I'd like cull out entities so they don't render behind my model of cube plane.

sick robin
#

DisableDepthWrite is at fault probably, since you're not writing to the depth buffer and entities that render after aren't aware that they're behind your object

dim girder
#

Alright, I'll attempt removing that and see if it resolves the issue.

#

Same issue.

"hide_entities:entity_alphablend": {
          "-states": [ "DisableCulling", "DisableDepthWrite"]
}
#

the barrier entity in the back is still showing.

sick robin
#

Blending materials are rendered very late, you need a material that can render early. If you inherit from entity_static and add DisableColorWrite, it should render earlier than all other materials

#

Then you can render the same geo but with alphablend material, which would have color

dim girder
#

This is my current material

"hide_entities:entity_static": {
     "-states": [ "DisableCulling", "DisableDepthWrite"],
      "+states": ["DisableColorWrite"]
}
#

I think, I am misunderstanding the last part you mentioned.

dim girder
#

I'm unsure how to do what you described "Then you can render the same geo but with alphablend material"

dim girder
#

Alright, I now understand what you mean now by rendering on the same geo using a second index in the render controller materials.

#

But the issue is still present, here is what I have.

#

Materials

    //hide1
    "hide_entities1:entity_static": {
      "+states": [
        "DisableColorWrite"
      ]
    },

    //hide2
    "hide_entities2:entity_alphablend": {
    }
#

Render Controller

      "materials": [
        {
          "*": "Material.hide1"
        },
        {
          "*": "Material.hide2"
        }
      ]
#

Still rendering the backend.

sick robin
#

By rendering second time I meant either duplicating cubes in the geo and assigning another material to them or adding a second RC that'd render the same geo but with different material

sick robin
dim girder
sick robin
#

Yeah, I should've been more clear originally, sorry

dim girder
#

Like this right or do you mean like in another render controller?

      "materials": [
        {
          "hide1": "Material.hide1"
        },
        {
          "hide2": "Material.hide2"
        }
      ],
#

I'm now targeting a bone called "hide1" and "hide2" each having a cube.

sick robin
#

That should be fine

dim girder
#

Okay, that hides entities behind it now like I wanted, but now the main model is invisible.

sick robin
#

Didn't know about the main model. Can you describe in details what you want to achieve again?

dim girder
#

Alright, to fix the issue I had to move the second cube out of the first one.

#

just a little.

#

So the rendering order worked it was hiding the texture because it was behind the other material.

#

Works, thank you so much! This is such a useful method.

#

Been needing this for ages!

sick robin
dim girder
#

Oh didn't think of that.

#

Thanks, I'll try that in a few.

dim girder
#

"Equal" caused Z-Fighting.

#

so trying the other few.

sick robin
#

Strange, it shouldn't. Are the bones exactly and completely the same?

#

Position, rotation, scale, everything should match, it should be an exact copy of the bone

dim girder
#

There was a pivot -0.02 off on the second bone, good catch!

#

Yep that worked.

#

Shows mobs, but doesn't show its self on the other side of each border face.

#

That's perfect!

#

Thank you Again Veka!

#

Lately you've been a real life saver lol. 😅

tall spindle
#

very neat

#

i’ve always thought materials were like hard coded but i’ve never actually tried to use them so

thorn lark
#

Afaik you can change and create custom entity and particle materials, ik you can’t change terrain or sky materials tho (I tried ;-;)

#

But yeah they’re surprisingly customizable

sick robin
dim girder
#

But creepers rendering all the basic mobs render and as you said slimes don't.

#

Sadly materials are limited in that regard that we can't tell them what we want to render, blocks, mobs, etc.

sick robin
#

Yeah, they're not very flexible when it comes to rendering order

deft hazel
#

@sick robin Can u help me in dms?

deft hazel
#

actually

#

u might don't want to help in dms

#

here

#

i'll show u my issue

#

basically it flickers

sick robin
#

Idk want kind of materials you're using or how it's supposed to look like, but one way to fix it would be to turn off dithering in accessibility settings

sick robin
#

So what's the effect that you're trying to achieve?

deft hazel
#

so it would be visible what am i aiming

#

btw scope and hiding parts are separate parts

#

{
"controller.render.awm_ocular": "c.is_first_person"
},
{
"controller.render.item.fp": "c.is_first_person"
},
{
"controller.render.awm_fp_scope": "c.is_first_person"
}

#

OH

#

OH OH

#

@sick robin U R GOAT THANKS

#

disabling dithering heped!!!!

#

sheeesh

#

U r the goat,bro i love u(not in gay term)

#

@gentle spruce r u spying on me or what

#

wtf

gentle spruce
#

what

#

i just found that funy

deft hazel
#

this post was made 4 months ago

gentle spruce
#

ok

#

years ago*

deft hazel
#

yeah and i see u in everyo post i comment

gentle spruce
#

i dont

deft hazel
#

nvm,yeah,year ago

deft hazel
gentle spruce
#

is it a problem if i just see posts

deft hazel
#

btw what do u think of my RP?

gentle spruce
#

nice

deft hazel
#

it's fully RP

gentle spruce
#

smooth aniamtions

deft hazel
#

not an addon

gentle spruce
#

wooo

deft hazel
#

and even has reload

#

imma show u

gentle spruce
#

reload in bow 👀

deft hazel
deft hazel
#

i'll add sounds later today

gentle spruce
#

thats crazy

deft hazel
#

and will finish scope part

deft hazel
#

it's only rp

gentle spruce
#

now replace the arrow with bullet

#

change arrow model

deft hazel
#

o btw

#

it also has inspect trigger

#

to inspect i have to sneak for 0.5 seconds

deft hazel
#

@sick robin

#

Can u help me rq

#

it broke with vibrant visuals

#

i added pbr to make it looking good

#

it seems like it doesn't support translucent textures and transparent with vibran visuals

#

btw am still using
"hide_entities1:entity_static": {
"+states": [
"DisableColorWrite"
]
},
//hide2
"hide_entities2:entity_alphablend": {
}

#

it works without VV

#

i rlly need it to get fixed

#

it will look so good

sick robin
#

Materials in VV are buggy and don't work as expected. There is probably a way to do it but it would be very difficult to do and quite a complex effect

deft hazel
#

cuz before this custom material method i used to use 2 alpha blend transparent cubes

#

2nd cube is like 1 pixel away

#

and it did work with VV