Jump to content

[1.8] Custom block model -> no ambient occlusion


DBLouis

Recommended Posts

Hi

 

There is no ambient occlusion on the ore block, which are rendered with a custom model.

Here one image to understand the problem :

1449055312-capture-du-2015-12-02-10-29-49.png

 

And some code :

Block class :

https://gist.github.com/Spooky4672/92d49f456b063e2fecdb

 

Model class :

https://gist.github.com/Spooky4672/6adc83c99b7593e4ab98

 

That's weird because in the model class ambient occlusion is set to true ...

Link to comment
Share on other sites

I'll have fry take a look at the issue, but also, why is this a custom model.. you're rendering a normal model... just with two layers... JSON should allow you to do that just fine.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

1) lighting system needs correct normals to be specified to generate the correct AO shadowing data; you're using very old hard-coded code to generate the vertex data, which doesn't do that - if you want to generate the model like this, look at custom model loaders that are in forge.

2) retexturing like this can be accomplished more easily - get cube model from the registry (ModelLoaderRegistry.getModel(new ResourceLocation("block/cube_all"), or something similar), or make a json model with 2 layers, which would be more appropriate for this; cast to IRetexturableModel (with checking), and call retexture. Look at uses of IRetexturableModel in forge for examples.

Link to comment
Share on other sites

I have tested a lot of things, nothings works. When you say "cast to IRetexturableModel (with checking)" can you show me an example. Because in every cases, I end up with a exception

Do I have to implement an IRetexturableModel ? Or can I use the class Wrapper in B3DLoader ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.