+2
Geplant

Small meshes are invisible in the 3D preview window

Goldfinger vor 11 Jahren aktualisiert von Freya Holmér (Developer) vor 11 Jahren 19
Admin Edit: Title changed. Original title and post below:
osx preview mesh not working

osx preview mesh not working nothing is displayed  version 0.18 latest unity 4 pro

Antwort

Antwort
Geplant
The preview should adapt to smaller meshes. 


Temporary fix:
It seems all meshes might have imported with a scale of 0.01, so the preview mesh was simply too small to be seen.

1. Search for sf_meshes in the project browser. (ShaderForge/Editor/Resources/Meshes/sf_meshes.fbx)
2. Select it and set its import scale to 1 instead of 0.01
Is it black, pink or simply not there?
Are you getting any errors in the console?
simply not there at all  both new shader and examples
That's scary. Does it happen in a fresh project too? What is your current render target?
did some tests all appears to work in a fresh project

but not in my main project  which is a osx build target with forward rendering  is there  some unsupported setting i should be looking for ?
Strange. I suppose there's some setting in that case. Perhaps in quality settings?
ive reset all the render / graphics / player and quality tabs to default still nothing
Also tried a asset full reimport that didnt work ethier

I have created a repo project  that reproduces the problem in your own example scene should I attach it here or do you have some other way you would like to receive this ?
Ah, cool! Upload it somewhere and link it :)
let me know you have it and ill remove the package
It seems all meshes have imported with a scale of 0.01, so the preview mesh was simply too small to be seen!
1. Search for sf_meshes in the project browser. (ShaderForge/Editor/Resources/Meshes/sf_meshes.fbx)
2. Select it and set its import scale to 1 instead of 0.01

Did it solve the issue?
yes ok that gonna be a issue as 0.01 is used to get the art pipeline correct scale 1 m unity unit from maya imports is there a way you could get the preview panel to take the asset import scale into account so its the correct size in the view?
The scale is per-asset, not globally, like Wesley said! I'm fairly sure this was the issue, so I'll make this as finished :)
All you would have to do is simply change the scale for the Shader forge preview mesh, not your universal import settings.

EDIT: Incase that isn't very clear, you can go to your ShaderForge folder in your project manager then Resources>Meshes>(click on)sf_meshes then in your inspector just change the scale from .01 to 1 then click apply. You should get a popup that asks you to if you are sure and want to re-import the package. Just agree and you should be good to go. 

If that still somehow causes issues you can always scale up your meshes on export in Maya.
Fixed
It seems all meshes might have imported with a scale of 0.01, so the preview mesh was simply too small to be seen.

1. Search for sf_meshes in the project browser. (ShaderForge/Editor/Resources/Meshes/sf_meshes.fbx)
2. Select it and set its import scale to 1 instead of 0.01
Fixed
It seems all meshes might have imported with a scale of 0.01, so the preview mesh was simply too small to be seen.

1. Search for sf_meshes in the project browser. (ShaderForge/Editor/Resources/Meshes/sf_meshes.fbx)
2. Select it and set its import scale to 1 instead of 0.01
that not going to be an option as the only way in unity at this time to set a import default globally is via scripts and it overrides the UI setting 

plus that doesn't fix the preview window for custom meshes assuming shaders get linked with the mesh in the future.

preview view really needs to calculate a distance or scale based on the mesh size same way F key frames an object in unity or maya.
It actually does calculate that, and has worked for the meshed I've tried, though they've been bigger, not smaller. (And you can use custom meshes right no)

But it's a good point, I'll make a new topic on that issue!
yes work fine on big meshes but to change the scale in maya would be everything in unity as 1 unit = 1 meter and the physics and other math is linked to this real world scale also and the project relies on keeping the float numbers small so there is less precision error

hopefully it will be minor addition for you to allow small meshes to preview correctly also thanks 
When you export say an FBX file you can change the export scale. You are not changing anything within maya, your grid units would all be the same. 

I am confused as to why you couldn't scale the mesh up in unity seeings as the preview mesh is only going to be seen in...well the preview?
using a older version of maya being used scale other than cm causes issues/ due to internal bugs cm defaults are kept  and unity used to be 0.01 import scale by default at the start of the project. They since changed it to 1 during 4.x releases which caused the need to change it back using preprocessor scripts to get the correct physic/units and world scale as unity internally still works best at 1=1m scale.

fbx scale in the version of maya i have access too doesn't output into unity without becoming the wrong scale as the scale in fbx changes the maya model scale and you end up with the object being wrongly scaled in unity .

Even if this was not an issue in future projects the shaderforge preview window should be size agnostic.

anyhow we use .ma files directly in unity. for the time being i'm continuing to experiment with shader forge in a separate project which can have default asset scale, but would be great if it could correctly preview small objects or at very least had a scale preference setting to override.  

is this something you could take the time to implement a fix for ?
It should work on small assets, but it seems like my algorithm for it didn't work. I'll have another look at it yea
Antwort
Geplant
The preview should adapt to smaller meshes. 


Temporary fix:
It seems all meshes might have imported with a scale of 0.01, so the preview mesh was simply too small to be seen.

1. Search for sf_meshes in the project browser. (ShaderForge/Editor/Resources/Meshes/sf_meshes.fbx)
2. Select it and set its import scale to 1 instead of 0.01