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

Texture warping on gateways when scaled #177

Open
Da-Technomancer opened this issue Jan 31, 2022 · 1 comment
Open

Texture warping on gateways when scaled #177

Da-Technomancer opened this issue Jan 31, 2022 · 1 comment
Labels

Comments

@Da-Technomancer
Copy link
Member

Describe the bug
The purple 'rift' texture on the gateway is warped or distorted for non-minimum size gateways, and tends to distort further when the gateway angle changes during dialing.

Screenshots [Optional]
(Image courtesy of Kortis on the Discord)
image

@Da-Technomancer
Copy link
Member Author

Da-Technomancer commented Jan 31, 2022

Issue is in this section:

//Render a double sided octagonal portal
//Bright lighting, translucent
//Has to be done via 3 quadrilaterals for the octagon, all done twice for both sides
int[] col = {255, 255, 255, 200};
//Switch builder to translucent
builder = buffer.getBuffer(RenderType.translucentNoCrumbling());
//Vertices are commented with the number of the vertex on the final octagon
//Front
CRRenderUtil.addVertexBlock(builder, matrix, octInWid, -octInLen, 0, portalUMid2, portalVEn, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//1
CRRenderUtil.addVertexBlock(builder, matrix, -octInWid, -octInLen, 0, portalUMid1, portalVEn, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//2
CRRenderUtil.addVertexBlock(builder, matrix, -octInLen, -octInWid, 0, portalUSt, portalVMid2, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//3
CRRenderUtil.addVertexBlock(builder, matrix, -octInLen, octInWid, 0, portalUSt, portalVMid1, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//4
CRRenderUtil.addVertexBlock(builder, matrix, -octInLen, octInWid, 0, portalUSt, portalVMid1, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//4
CRRenderUtil.addVertexBlock(builder, matrix, -octInWid, octInLen, 0, portalUMid1, portalVSt, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//5
CRRenderUtil.addVertexBlock(builder, matrix, octInLen, -octInWid, 0, portalUEn, portalVMid2, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//8
CRRenderUtil.addVertexBlock(builder, matrix, octInWid, -octInLen, 0, portalUMid2, portalVEn, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//1
CRRenderUtil.addVertexBlock(builder, matrix, -octInWid, octInLen, 0, portalUMid1, portalVSt, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//5
CRRenderUtil.addVertexBlock(builder, matrix, octInWid, octInLen, 0, portalUMid2, portalVSt, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//6
CRRenderUtil.addVertexBlock(builder, matrix, octInLen, octInWid, 0, portalUEn, portalVMid1, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//7
CRRenderUtil.addVertexBlock(builder, matrix, octInLen, -octInWid, 0, portalUEn, portalVMid2, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//8
//Other front
CRRenderUtil.addVertexBlock(builder, matrix, octInWid, -octInLen, 0, portalUMid2, portalVEn, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//1
CRRenderUtil.addVertexBlock(builder, matrix, -octInLen, octInWid, 0, portalUSt, portalVMid1, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//4
CRRenderUtil.addVertexBlock(builder, matrix, -octInLen, -octInWid, 0, portalUSt, portalVMid2, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//3
CRRenderUtil.addVertexBlock(builder, matrix, -octInWid, -octInLen, 0, portalUMid1, portalVEn, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//2
CRRenderUtil.addVertexBlock(builder, matrix, -octInLen, octInWid, 0, portalUSt, portalVMid1, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//4
CRRenderUtil.addVertexBlock(builder, matrix, octInWid, -octInLen, 0, portalUMid2, portalVEn, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//1
CRRenderUtil.addVertexBlock(builder, matrix, octInLen, -octInWid, 0, portalUEn, portalVMid2, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//8
CRRenderUtil.addVertexBlock(builder, matrix, -octInWid, octInLen, 0, portalUMid1, portalVSt, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//5
CRRenderUtil.addVertexBlock(builder, matrix, -octInWid, octInLen, 0, portalUMid1, portalVSt, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//5
CRRenderUtil.addVertexBlock(builder, matrix, octInLen, -octInWid, 0, portalUEn, portalVMid2, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//8
CRRenderUtil.addVertexBlock(builder, matrix, octInLen, octInWid, 0, portalUEn, portalVMid1, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//7
CRRenderUtil.addVertexBlock(builder, matrix, octInWid, octInLen, 0, portalUMid2, portalVSt, 0, 0, 1, CRRenderUtil.BRIGHT_LIGHT, col);//6

This does not need to be rendered as a three-segment octagon; taking advantage of the cutout render type by switching to a single square polygon encompassing the full octagonal area would simplify the transformations of the vertices, probably eliminating any errors.

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

No branches or pull requests

1 participant