Optimizing draw function for texured triangle
https://github.com/asdru22/3D-Graphics/blob/rasterization/src/main/java/geom/Triangle.java
My current implementation basically implements a rasterization algorithm from scratch, which isn't very efficent. But i don't know how i would otherwise make a triangles texture rotate with it
GitHub
3D-Graphics/src/main/java/geom/Triangle.java at rasterization · asd...
Contribute to asdru22/3D-Graphics development by creating an account on GitHub.
14 Replies
⌛
This post has been reserved for your question.
Hey @asdru! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
If there's a better solution that involves built in functions im all ears but i couldn't find anything
i tried reducing the calls to the draw function by
- grouping textures with the same color img 1
- combining the pixels in a new image and drawing that (img 2), this also looked worse
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
do you know why this draws a cube but if i call the scene.draw method
it doesnt draw the cubes?
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
.
Why dont you use OpenGL?
You can even implement your custom algorithms on fragment shader
lets say its a personal challenge and im trying to learn 3d graphics
i tried lwjgl too but didn't like it since ur working with ints
It uses int for the addresses, in any library we have it... If you want to learn 3D graphics, you must know how these work. If you want faster rendering of triangles and cubes, I think the best choice is to go to openGL. If not, you can use multi threads and simp (special occasions)
I think it's slow cause of creating a buffer for every rendering call. You should avoid creating this every frame
its not super slow so far i have 50 triangles on my screen and its still running at 60fps
but i should test it further
thanks for the advice!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
I think at least you can render 1-5 milion triangles with your gpu(with ancient one) :kekw:
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.