#in case i wanted to tweak it

1 messages · Page 1 of 1 (latest)

wooden perch
#

Why would using fullscreen pixelation prevent you from doing that

#

Pixel perfect camera upscaling sets the screen resolution to match your sprite pixel resolution
So their appearance would be unchanged
But anything else would be pixelated to match the same pixel grid

#

Which means particles and meshes will fit seamlessly with pixel sprites

tulip tendon
#

so you're suggesting that I pixelate everything at runtime

#

that are meshes and whatnot

wooden perch
#

The whole screen
It'd be much much simpler

#

But you can't have non-pixelated and pixelated objects separately then, of course

tulip tendon
#

yeah I see what you mean

#

but I want to edit the faux pixel art from my 3d models

#

I think I still have to go with making textures out of them first in order to do that

#

I also have no pixel art at all currently. I suck at art

wooden perch
#

If you just want sprites from a 3D model, and it doesn't have to be at runtime, blender is probably a more convenient environment for setting up the workflow for that

#

Unity works for it too since you don't apparently shy away from making entirely custom tools

tulip tendon
#

yeah I picked up blender like literally 3 days ago so I automatically decided to do it in unity haha

wooden perch
#

But if you do produce ultimately just sprites, I don't see the point of having multiple renderers

tulip tendon
#

I mean it's the solution I arrived at after searching online a bit

#

how else can I do it? it seemed the best way to make my tool accessible

wooden perch
#

I don't quite understand what it achieves at all

tulip tendon
wooden perch
tulip tendon
#

i got this normal map thing by swapping to renderer with a shader that gets normal data

#

let me see the link

#

oh

wooden perch
#

Ah right because your tool outputs to a fullscreen shader or something, not that the renderers are meant to help with displaying the generated result

tulip tendon
#

yeah

#

wait

#

my extra renderer was a simple way for me to get the monkey to have normal map colors which I could easily just render out to a texture

#

seemed obvious enough when I did it

#

I just need also a way to get emissive data and do the same thing again for that

wooden perch
#

In that context I get it
I wouldn't have the patience to customize Unity for that task
Blender would let you output any passes you want without any extra tooling

tulip tendon
#

interesting, I'll probably have to look into that

#

I'm like 90% done already in unity though lol

wooden perch
wooden perch
tulip tendon
#

yeah so

#

currently I thought maybe I can just make anything I want emissive in blender to be fully white

#

and then that gets marked as emissive

#

but my shader is not behaving how I expected

#

i.e. I tried to set any pixel with r, g, b > 0.98 to be white and anything else to be black

#

but for some reason the white pixels that I can see on screen are actually like 0.6 or something

wooden perch
#

What shader and what's the utility of blender if you're baking the texture in unity

tulip tendon
#

I only had like an hour last night before bed

tulip tendon
#

I can't do that in unity right so

wooden perch
#

And are they 0.6 in blender, or in unity before baking or after baking

tulip tendon
#

this is my shader

#

and it is before baking

#

let me do a thing, one sec

#

if I set threshold to like 0.8 the eyes disappear and it's just black

#

which didn't make sense to me

#

idk I feel like writing this approach off as a stupid hack and seeing if I can actually get the emissivity from the material of the model instead

#

it was easy for normals in the shader

wooden perch
#

Why not render emissiveness as a texture or a vertex color channel instead
If it starts at pure black/white you wouldn't even need to process it like this

tulip tendon
#

how can I do that?

wooden perch
#

Assign a shader on the mesh that directly outputs a vertex color or an uv unwrapped emission texture

#

Applying either of the two has to happen in blender naturally

#

Afaik Unity has no concept of an "emissive pass" so you'd have to swap the material to bake the emissive at any rate

tulip tendon
#

hmm okay

tulip tendon
wooden perch
#

Standard process for exporting and displaying any mesh with either of those two

tulip tendon
#

any resources you could point me towards for doing this? I'm not sure where to start

#

I appreciate the help a lot

wooden perch
#

You've already been making a system more complicated than I ever had to make, but asking questions about the most basic fundamentals so I don't exactly know where to start either

tulip tendon
#

lol yeah

#

I guess it's because my approach is just

#

learning whatever I need for my specific goal

#

so I probably skipped out on a lot of basic knowledge

wooden perch
#

It might be most beneficial to learn enough blender to uv map and texture a model and maybe use vertex colors also, then export it to Unity and get it to show up with textures using the Lit material
In Unity after that you'd want to make a shader graph that applies a texture to the mesh, then applies vertex colors also

#

All in 3D URP, not 2D URP yet
2D URP is technically 3D but with some particular limitations

tulip tendon
#

ok

tulip tendon
#

I think this looks good?

tulip tendon
#

@wooden perch so as far as I understand, this material is using the default URP Lit shader to display the diffuse color in the right spots. The shader knows what part of the UV unwrapped texture goes where because the mesh data contains UV coords for its vertices

tulip tendon
#

so now I'm guessing I need to make a shader graph that replaces the URP Lit shader and that will let me do things like access the emission map and change the colors and stuff?

wooden perch
wooden perch
#

That's what you would have to do to use vertex colors for lit emission or unlit output

#

I assume you're still using the 2D renderer because you have an emission map in the material, but it's not having any effect

tulip tendon
#

correct

wooden perch
#

2D renderer ignores all Lit material features besides BaseMap, because it's designed just for sprite shaders and internally sprite shaders use BaseMap property as well

tulip tendon
#

can't I directly work with the emission map as data anyway?

wooden perch
#

It's after all just a stripped down 3D renderer

wooden perch
tulip tendon
#

I think it does work

#

although I see some slight artifacts

#

i think that may be due to my baking skills

#

it's probably my baking skills, pretty sure my emissive parts are leaking a bit into other parts of the model in the uv unwrap, but that's ok for now

tulip tendon
#

is it possible to make a shader override step in a renderer that can take the emissive data directly from the model?

wooden perch
#

Via render objects renderer feature with material override

#

Considering there doesn't seem to be any reason you need to use the 2D renderer for this process, it would not be a problem

#

As you may recall the 2D renderer is the same as 3D renderer but with features thought to be unnecessary for sprite rendering stripped out

#

(With 2d lighting, pixel perfect rendering and advanced 2D sorting added in)

tulip tendon
#

The bot just 1984’d my gif

#

The 2d renderer doesn’t support it as in the emissive map gets discarded or something?

wooden perch
#

2D renderer doesn't support Renderer Features at all as far as I know

tulip tendon
wooden perch
#

Ah, I see it does support Render Objects now
Probably a new thing
There you have material override

tulip tendon
#

If I override the material it sounds like it’ll lose the material properties

#

You can shader override and keep the material properties right

wooden perch
#

Best I can tell you will lose them, but it's something I've been looking into too

#

You'll probably need two materials and manually swap between them
Again because Unity doesn't render diffuse and emission in different passes

#

Emission is just a color that's added to the mix without it being multiplied by shadows

tulip tendon
#

ok we're getting into interesting territory

#

just wondering, what is UV0? is this the baked UVs

#

I get this result from that shader graph

#

I guess something is happening with tangent space that is causing there to be lighting

wooden perch
#

Oh right the Override Mode: Shader maintains material properties rather than overriding them
Makes sense I suppose

tulip tendon
#

based on looking inside the Lit shader and seeing that there was a variable called _EmissionMap

#

and it looks like it's there on the monkey, the eyes are white and the rest of the monkey is black I think because the emission map is black everywhere else

wooden perch
tulip tendon
#

so... if I just do an unlit shader instead it'll "just work"

wooden perch
#

So it's not all that bright

tulip tendon
#

it looks correct with an unlit shader override

#

wow! I think i'm finally done?

wooden perch
tulip tendon
#

right

#

I think I didn't put any lights in the scene though

wooden perch
#

Usually it wouldn't be possible to get either of those two on a mesh when using the 2D renderer, so I wonder if that's changed in an update too

tulip tendon
#

but it only gets the lit stuff after I did the override

wooden perch
#

Yes

tulip tendon
#

I guess the update allowing renderer features in 2d also allowed this

wooden perch
#

Curious to me

wooden perch
tulip tendon
#

right right

#

okay, I think i'm finally ready to try to put all the textures together and see how it looks

#

I'm gonna be really sad if it looks bad

#

@wooden perch I'm curious actually - I've seen the material properties in blender such as metallic and roughness maps, subsurface, etc. do these exist for 2d graphics?

#

I don't really see how something can look metallic in 2d

wooden perch
tulip tendon
#

technically?

#

how so

wooden perch
#

The difference of metallic and nonmetallic is mainly two things, metallic materials only get specular lighting and the reflected light is tinted by the color map

#

2D lighting doesn't have any environmental reflections (nor ambient light) so a metallic material wouldn't really look like much

tulip tendon
#

I did think about how you could manually create reflections

wooden perch
#

But when it comes down to it there's no fundamental difference between 3D and 2D lighting, at least not in the blending part
2D lighting just happens to be simpler

tulip tendon
#

mostly about clear water

#

I think you could make something look metallic by just having it reflect stuff in the scene like the player if the player was next to it

wooden perch
#

In 3D workflow doing even that much is not necessary
By default specular reflections come from the skybox
But 2D games don't tend to have a concept of a skybox

tulip tendon
#

also - may I ask about your background? you know a lot about this stuff as well as unity-specific things

wooden perch
#

Just been doing this stuff and game graphics in general for a few years

tulip tendon
#

i dont think I could have gotten all this together this fast without your help

#

so thanks again

wooden perch
tulip tendon
tulip tendon
#

@wooden perch in case you wanted to see the results haha

wooden perch
#

Maybe not the most efficient methods, but going into easier techniques from there should be relatively a breeze

tulip tendon
tulip tendon
#

I wonder if this'll come back to bite me in the ass when I want to add new things

#

like cloth simulation or smear frames

wooden perch
#

Cloth simulation usually fares poorly when it's baked rather than realtime, if it needs to be reactive

#

You mentioned you wanted to have the models baked into textures because you needed to edit them in some way
Those edits might've been doable on the mesh before baking, or as a sprite companion to a realtime rendered pixelated mesh

#

But it depends much on what those would be

tulip tendon
tulip tendon