#in case i wanted to tweak it
1 messages · Page 1 of 1 (latest)
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
so you're suggesting that I pixelate everything at runtime
that are meshes and whatnot
The whole screen
It'd be much much simpler
But you can't have non-pixelated and pixelated objects separately then, of course
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
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
yeah I picked up blender like literally 3 days ago so I automatically decided to do it in unity haha
But if you do produce ultimately just sprites, I don't see the point of having multiple renderers
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
I don't quite understand what it achieves at all
Just one renderer is enough for utilizing multiple sprite textures at once
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@16.0/manual/SecondaryTextures.html?q=secondary
i got this normal map thing by swapping to renderer with a shader that gets normal data
let me see the link
oh
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
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
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
interesting, I'll probably have to look into that
I'm like 90% done already in unity though lol
There's also an addon for generating flipbook sequences / sprite sheets while at it
https://extensions.blender.org/add-ons/sequenced-bake/
Granted, Unity has one too
https://github.com/Unity-Technologies/VFXToolbox
90% through the hard way already!
I wish I had your tenacity
But my laziness saves me a lot of trouble
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
What shader and what's the utility of blender if you're baking the texture in unity
I only had like an hour last night before bed
workflow is to make simple models and animate them in blender
I can't do that in unity right so
And are they 0.6 in blender, or in unity before baking or after baking
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
To me this looks like a very convoluted step function
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
how can I do that?
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
hmm okay
this won't "transfer" to unity right? i'd have to render out the atlas in blender
Vertex colors and UV unwraps do transfer
On Unity side you'd need a shader that outputs the vertex color, or a b/w texture using the unwrapped UV coordinates
Standard process for exporting and displaying any mesh with either of those two
any resources you could point me towards for doing this? I'm not sure where to start
I appreciate the help a lot
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
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
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
ok
@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
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?
Serviceable!
Correct 
You could ge the same result using the Unlit shader using just your emission map
But I would recommend doing it in Shader Graph for the sake of practice
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
correct
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
can't I directly work with the emission map as data anyway?
It's after all just a stripped down 3D renderer
If you make an unlit material with your emission map, I expect that works
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
you said I could do this in shader graph for practice, and I do want to try - I also want to somehow make this automatic instead of needing to assign the emissive texture manually to a material
is it possible to make a shader override step in a renderer that can take the emissive data directly from the model?
In 3D renderer very easily, but 2D renderer doesn't support it
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)
The bot just 1984’d my gif
The 2d renderer doesn’t support it as in the emissive map gets discarded or something?
2D renderer doesn't support Renderer Features at all as far as I know
But i used it to add a shader that gave me my normal texture
Ah, I see it does support Render Objects now
Probably a new thing
There you have material override
If I override the material it sounds like it’ll lose the material properties
You can shader override and keep the material properties right
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
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
Oh right the Override Mode: Shader maintains material properties rather than overriding them
Makes sense I suppose
so the good news from this is that I tried doing _EmissionMap as a property
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
Yes, the UV coordinates that are saved into your mesh when you UV unwrap it in blender
There can be more than one channel and UV0 is the first one
so... if I just do an unlit shader instead it'll "just work"
Yes, since the _EmissionMap is a property shared by multiple shaders, the shader override mode lets your object inherit it from its previous shader
But in this case you're using the emission map as your diffuse, not as emission
So it's not all that bright
Not exactly about tangent space
Lit shader gets all kinds of lighting calculated into it, like ambient and reflections from the scene
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
normally the mesh is rendered completely flat riight
but it only gets the lit stuff after I did the override
Yes
I guess the update allowing renderer features in 2d also allowed this
Curious to me
Scene lighting comes from the scene itself, controlled by Lighting>Environment rather than any component
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
They don't, but technically they could
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
I did think about how you could manually create reflections
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
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
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
also - may I ask about your background? you know a lot about this stuff as well as unity-specific things
Just been doing this stuff and game graphics in general for a few years
i dont think I could have gotten all this together this fast without your help
so thanks again

Yes
you did it!
Maybe not the most efficient methods, but going into easier techniques from there should be relatively a breeze
what would you have done? just rendered it all out in blender first?
Yes, or kept it 3D
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
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
I think for my case I just want a really simple cape for my character
mostly meant for when I needed to smooth out some rogue pixels, nothing too crazy