Jump to content

Problems with a TESR


Pennyw95

Recommended Posts

Hi, today I need some help with my TESR.

 

I managed to get it actually rendering correctly from every angle and to enable blending in order to allow for transparent textures ( for the glass pane).

Right after I got the transparent panes,though, I noticed that some internal parts are not being rendered!

I tinkered with the the main block class, the TE class and the renderer but nothing changes....it breaks sometimes.

 

Here are some pictures: you can see from the Tabula screen how it should render. In-game it's missing 3 legs and the purple floor.  http://imgur.com/fckjD2x,CR8luyo,1WGDeMe

In the second image the TESR is not correctly aligned with the bounding box, don't mind that.

 

 

Renderer: http://pastebin.com/1CGvz03T

Link to comment
Share on other sites

Hi

 

You're probably running into the problem that alpha blended quads have to be rendered in a specific order.  You have to render the furthest-away quads first.  If you render the closest quad first, then when you draw the furthest quad, the depth culling hides it.

This isn't easy to fix.  If you turn off depth culling, your quads render in front of everything, even solid blocks.

If you turn off writing to the depth buffer when drawing alpha blended quads, the result will still look different for

front quad first, back quad last 

vs

back quad first, front quad last

 

You need to sort the quads in your TESR to render the furthest ones first.  So long as the quads don't intersect, this isn't very difficult.  In your case, it might be enough just to render all the non-alpha-blended parts first, then the glass panes second (keep back-face culling on for the glass panes).

 

-TGG

 

 

Link to comment
Share on other sites

Oh I see...thanks for explaining me :)

 

I'll try to make a separate method for rendering the glass panes in the model and call it later in the renderer first, if doesn't work I'll change the order from back to front (but wouldn't this mean I'd still have the problemi while looking from behind?)

 

Unfortunately I'm away this week, I'll let you know ad soon as I can how it goes. Thanks again :)

Link to comment
Share on other sites

  • 2 weeks later...

Hey, I did as you suggested and put the glass in a separate render method that I call after the primary one, and all the trims are working as expected, but the thing is still not rendering properly, as you can see in the pics:

 

http://imgur.com/YLXJYLd,53SSAsg,20YlUpI

 

It seems the jarInside box is never rendered even if putting printlines inside the method proves it gets executed...

What may I be doing wrong?

 

Code:  http://pastebin.com/HHnuSn0r

 

EDIT: Updated paste, should be less confusing. Do not mind that renderGlass is not called, my issue is with renderFloor not rendering.

Link to comment
Share on other sites

Hi

 

I'm having trouble seeing what's wrong in your images :)

 

But I suggest to troubleshoot by

1) Render just the solid parts, including jarInside, without rendering the glass

Your floor might not be rendering if the floor is facing the wrong way (or backface culling is on), or your floor exactly overlaps one of the others

 

Once that works;

2) Turn on your alpha blending and render the glass as well, after the solid parts and jarInside.

 

-TGG

 

 

 

Link to comment
Share on other sites

Thanks for replying :)

 

The third image shows how the model, opened in Tabula, should render. The first and and the second image show that the jarInside (the model's internal floor) is not rendering.

 

I tried removing the glass and messed with culling already but that simple box just kept refusing to show up.

 

In the end, I solved the problem by removing it from the model class and tessellating it separately, in the renderer class.

So, although in an unorthodox way, my problem is now solved.

 

Thanks for your precious help, I learned alot from you advice :)

 

 

 

EDIT: One last question: I want to render some particles during the crafting process but after setting up the packet I realized that the particles are invisible if spawned inside the model, the transparent part, but they work if spawned above it.

Is there way to bypass this limit?

Link to comment
Share on other sites

Hi

 

Keen :)

 

Re particles - I think that will be tricky because the particles render after all the blocks are finished.  You would need to draw the particles before the transparent glass, i.e as part of your tessellator instead of as EntityFX particles.  It can be done, but it's a bit tricky (basically - your tessellator would keep track of the EntityFX, move them & render them, etc, instead of spawning them as you normally would.)

 

-TGG

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.