Jump to content

[1.15.2] obj model render


Fronsi

Recommended Posts

Hi, I'm creating a mod containing several block types that probably aren't in the ConquestRegorged modification if the mod comes out on version 1.15.
I decided to write this post because I can't deal with two probably simple things.

 

MC version: 1.15.2

Forge version: 31.1.0

 

Git repo: https://github.com/fronczek7f/ConquestReforged-Addon_1.15.2


First problem:

 

I created the RoofTileBlock class based on StairsBlock and the block itself uses the wavefront .obj format model. I wanted it to be a wavefront model because I can't make corners in Blockbench. As far as I know, in the current version 1.15 you do not need to use OBJLoader anymore, all you have to do is indicate in the model json file that you use the vol. Format And so I did, partly I helped myself using MinecraftByExample and the example given there. The effect is like the photo below but I have some problems...

 

Spoiler

2020-04-10_12_07_35.thumb.png.8c51e3e0c5f6feada5d3ad7c51641d14.png

 

It looks good to me but as you will see in the next picture there is a problem that I am currently unable to fix.

 

Spoiler

2020-04-10_12_07_47.thumb.png.d7e8532074d9384c520b24a7fc28664c.png

 

Normally in previous versions of Forge I would use the isOpaqueCube, isFullBlock, isFullCube etc. methods but at the moment I do not know what it can be and whether it is available as public. Most of the methods that I normally used in 1.12.2 just are gone or exist under a different name.

 

Second problem:

 

It concerns the rendering of the model itself, the problem can be seen in the photo.

 

Spoiler

2020-04-10_12_08_04.thumb.png.b89d9fecf26d9ff9eebbb6a9901b8374.png

 

When I put one block this problem is not visible but if I put next block, no matter what one triangle becomes a bit darker and I do not know what it depends on.

Link to comment
Share on other sites

Hi

isOpaqueCube, isFullBlock, isFullCube are gone now.  You specify a VoxeShape instead, and Minecraft figures those properties out by itself.

http://greyminecraftcoder.blogspot.com/2020/02/block-shapes-voxelshapes-1144.html

 

The corner getting darker looks a lot like the AmbientOcclusion calculations going wrong.

This link has the basic concepts (method names etc out of date but the concepts are still relevant)

http://greyminecraftcoder.blogspot.com/2014/12/lighting-18.html

 

I did read a post a while ago that the ambient occlusion calcs in minecraft assume a certain vertex order on the faces.  They also assume faces that point east, west, north, south, up, or down (i.e. not at an angle like yours).  I'm not sure how to fix that, unfortunately.   You might need to turn ambient occlusion off (I think that turning off detectCullableFaces flag in your model file might help with that - but I am not sure).  Otherwise you'll need to trace into the rendering code and see how it is manipulating your face' vertex information- this might quite possibly cause you serious head damage based my own attempts at trying to understand what happens in that code.

If you crack it please let me know? -!

 

Cheers

  TGG

 

 

Link to comment
Share on other sites

Quote

Hi

isOpaqueCube, isFullBlock, isFullCube are gone now.  You specify a VoxeShape instead, and Minecraft figures those properties out by itself.

http://greyminecraftcoder.blogspot.com/2020/02/block-shapes-voxelshapes-1144.html

 

The corner getting darker looks a lot like the AmbientOcclusion calculations going wrong.

This link has the basic concepts (method names etc out of date but the concepts are still relevant)

http://greyminecraftcoder.blogspot.com/2014/12/lighting-18.html

 

I did read a post a while ago that the ambient occlusion calcs in minecraft assume a certain vertex order on the faces.  They also assume faces that point east, west, north, south, up, or down (i.e. not at an angle like yours).  I'm not sure how to fix that, unfortunately.   You might need to turn ambient occlusion off (I think that turning off detectCullableFaces flag in your model file might help with that - but I am not sure).  Otherwise you'll need to trace into the rendering code and see how it is manipulating your face' vertex information- this might quite possibly cause you serious head damage based my own attempts at trying to understand what happens in that code.

If you crack it please let me know? -!

 

Cheers

  TGG

 

Thanks for the answer, I'm just checking the problem with VoxelShape and I think I know how to fix it, so I think this part of the problem is partially solved.

As for the second problem, I turned off detectCullableFaces but I didn't notice any improvement. I also tried with ambientToFullbright changing the value from true to false but the effect was only a darker model.

This is a bit annoying. In version 1.12.2, the same models worked well and did not cause the above problems...

I will try to deal with it yet.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

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.