Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambert should be set to Phong on materials in xmodel_export files #12

Closed
gmzorz opened this issue Apr 7, 2018 · 20 comments
Closed

Lambert should be set to Phong on materials in xmodel_export files #12

gmzorz opened this issue Apr 7, 2018 · 20 comments

Comments

@gmzorz
Copy link

gmzorz commented Apr 7, 2018

once the xmodel_export files are created, phong shading is off by default..
i don't know if lambert does anything, but it's badly shaded without phong

@SE2Dev
Copy link
Collaborator

SE2Dev commented Apr 7, 2018

Which game are you checking on?

@gmzorz
Copy link
Author

gmzorz commented Apr 7, 2018

Actually, scrap what i said, i thought it would work but i didn't test it out myself
i am having an issue with the shading on xmodels, in cod4

image

what i meant with phong shading ^ you can clearly see the edges, while it's supposed to look shaded
had to use a quick example, but this happens on all models i export using blender-cod.

@SE2Dev
Copy link
Collaborator

SE2Dev commented Apr 8, 2018

What is the name of that model, and which version of Blender-CoD are you using?

@0x8080
Copy link

0x8080 commented Apr 8, 2018

@SE2Dev It's a giant M40a1

@gmzorz
Copy link
Author

gmzorz commented Apr 9, 2018

it's just the m40 i had to compile into a mod, replaced me_concrete_barrier real quick, happens with all models i compile, i'm using the latest version from this page.
you can see it on this model as well, which is a custom one
just anything made with blender shows up with the edges clearly visible image

@0x8080
Copy link

0x8080 commented Apr 9, 2018

Why is there a PSO on an M40?

@CoDEmanX
Copy link
Owner

CoDEmanX commented Apr 9, 2018

If I understand correctly, smooth shading using vertex normals is desired here? Is the mesh shading set to smooth (on faces) in Blender?

@SE2Dev
Copy link
Collaborator

SE2Dev commented Apr 10, 2018

Can you show me a screenshot of the Blender-CoD add-on page in Blender so I know exactly which version you're using?

I need to know if you're using a development version or an older version.

@gmzorz
Copy link
Author

gmzorz commented Apr 10, 2018

yes, all faces are set to smooth
here's the one im using
image

Here's what it looks like in blender:
image

and ingame:
image

@CoDEmanX
Copy link
Owner

CoDEmanX commented Apr 10, 2018

Looks like it exports the face normals instead of the vertex normals.

Well, that's the super old version 0.3.5, which is from 2012. It is also the only release available on GitHub.

Please try the latest code from master branch. @SE2Dev or development branch?

@CoDEmanX
Copy link
Owner

0.3.5 seems to export vertex normals:
https://github.com/CoDEmanX/blender-cod/blob/blender_26/io_scene_cod/export_xmodel.py#L536

But since it looks like face normals in-game, there might actually be some problem with Blender. For instance, the vertex normals might require to be updated if to_mesh() is used to triangulate...

@gmzorz
Copy link
Author

gmzorz commented Apr 10, 2018

this is what i get from the master branch, when i try to tick the checkbox in add-ons
image

@CoDEmanX
Copy link
Owner

CoDEmanX commented Apr 10, 2018

Did you use Download Zip?

image

That's not going to work. You need to download the repo, extract the content and zip the subfolder io_scene_cod. That newly created archive should install in Blender. Alternatively, you could delete the existing folder io_scene_cod in %appdata%\Blender Foundation\Blender\2.78\scripts\addons and place the new one there.

@SE2Dev
Copy link
Collaborator

SE2Dev commented Apr 10, 2018

This should work for the time being.
blender-cod_beta.zip

@gmzorz
Copy link
Author

gmzorz commented Apr 14, 2018

image
sorry for the late reply, been busy with alot of things, this is what happens when i export as xmodel_export. selected all objects in the scene

@SE2Dev
Copy link
Collaborator

SE2Dev commented Apr 16, 2018

I assume your model has a skeleton, materials, uv maps, etc.
You should just need to select the model and choose export from the menu. If that doesn't work, try using this version: io_scene_cod_beta2.zip

@gmzorz
Copy link
Author

gmzorz commented Apr 20, 2018

not sure if i'm doing it right..
image

here's the process:
https://streamable.com/eawkj

@SE2Dev
Copy link
Collaborator

SE2Dev commented Apr 20, 2018

Ah, I see what happened. When I rewrote the export logic, I made it so that it'd look only for models that had skeletons, and forgot to restore the ability to automatically generate the default skeleton for static models. I still need to re-implement this feature.

In the mean time, you should be able to resolve this issue by adding a skeleton with a single bone (called tag_origin) and linking it to the model.

@gmzorz
Copy link
Author

gmzorz commented Apr 21, 2018

that actually makes alot of sense, thanks alot, i'll try it out asap

@SE2Dev
Copy link
Collaborator

SE2Dev commented Aug 7, 2018

I'm going to close this issue as it appears to have gotten somewhat off topic, and the original issue appears to have been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants