Shaders not working

Can anyone help with this? I am creating a water shader using Unity’s water shader tutorial but the result is not reflecting in needle engine

Original Post on Discord

by user 384185988336844802

Hello, did you mark your shader with the ExportShader Asset label? That’s currently required for exporting custom shaders. Also note that we dont support custom lit shaders yet - so every shader that uses unity lights basically

You can still try exporting it - but there’s no guarantee right now that it will look correct in the browser

That being said: we might get support for it relatively soon

Or at least basic support :slightly_smiling_face:

yea, i did add exportshader label

by user 384185988336844802

Can you change the diffuse color of your shader in unity and verify you see the color change in the web?

Hi, I made a little shader via shadergraph and I’m trying to use the second set of uvs, mimicking a lightmap so I can have a “lightmapped” prefab, is there any reason why this does not work?

by user 262331051802755072

by user 262331051802755072

it’s unlit and tagged as export shader

by user 262331051802755072

Hey, what does it show in engine? Or do you get any errors in the browser console / logs in the editor that might be related?

Regarding lightmapped prefab: is exporting a scene with lightmaps maybe a solution? (You can reference a scene and load it the same way as with a prefab but the scene can contain lightmaps already)

Here is a simple component that loads an array of scenes Script Examples | Needle Engine Documentation

on unity editor it looks as it should, on browser it’s just unlit with the main texture, second texture doesn’t do anything

by user 262331051802755072

no logs on browser at all

by user 262331051802755072

Ok, thanks. Have you considered this? Is there a specific reason to use another (custom) approach?

I’m looking into both solutions, but I’m baffled about this one not working… maybe tomorrow with a fresh set of eyes…

by user 262331051802755072

well the reason is this makes sense for prefabs/models to be used in procedural content, as regular lightmapping would not be possible… do you think you could get your eyes on a repo with the shader and model?

by user 262331051802755072

Yes I can take a look, could you send me a simple repo (or a small test scene zipped using the Needle Engine/BugReport/Zip Scene menu item) ?

hey so the uv2 variable is not correctly exported / translated to threejs on export. I’ll see if that’s an easy fix :slightly_smiling_face: