gotet Posted August 10, 2020 Posted August 10, 2020 (edited) Where should I look in the server code to find where textures with gray pixels are tinted? (Examples are grass or redstone dust). I have found out that they do that according to the colors calculated from BlockColors.java but I dont know where the math or opengl tricks occurs. Is it like I assume, color multiplication that is happening? I am maybe blind, but where do I find the possible color values for redstone dust? Edited August 10, 2020 by gotet Quote
Draco18s Posted August 10, 2020 Posted August 10, 2020 (edited) 1 hour ago, gotet said: server code 1 hour ago, gotet said: textures Textures are client side only. You will not find any server code related to colorization. For redstone wire, the math is in RedstoneWire#colorMultiplier(). All it does is return a color (255 RGB as a single unsigned integer) that is then multiplied against the texture when it is rendered. As for where OpenGL gets involved? Dunno, its buried inside the ModelBakery. Edited August 10, 2020 by Draco18s Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
gotet Posted August 10, 2020 Author Posted August 10, 2020 When I searched in eclipse in version 1.16.1-32.0.108, I only found one file containing "colormultiplier": output.srg. Quote
Draco18s Posted August 10, 2020 Posted August 10, 2020 I don't have a 1.16 workspace, but its a method that returns an int and has a line that looks like "return -16777216 | i << 16 | j << 8 | k;" (the "-16777216" part is just FF for alpha, already bit-shifted). Alternatively, dig into where BlockColors gets referenced and how. 1 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
gotet Posted August 11, 2020 Author Posted August 11, 2020 Hm, I dont even know how to search for the text 16777216. File search in eclipse seems broken. Quote
Draco18s Posted August 11, 2020 Posted August 11, 2020 Don't search the whole project for that string, search in RedstoneWireBlock. Or go to BlockColors and look at how RedstoneWire's color gets registered and work backwards. 1 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
gotet Posted August 11, 2020 Author Posted August 11, 2020 Yeah, got it! static { for(int i = 0; i <= 15; ++i) { float f = (float)i / 15.0F; float f1 = f * 0.6F + (f > 0.0F ? 0.4F : 0.3F); float f2 = MathHelper.clamp(f * f * 0.7F - 0.5F, 0.0F, 1.0F); float f3 = MathHelper.clamp(f * f * 0.6F - 0.7F, 0.0F, 1.0F); field_235542_k_ = new Vector3f(f1, f2, f3); } } Quote
gotet Posted August 11, 2020 Author Posted August 11, 2020 (edited) Could not remove this comment. Edited August 11, 2020 by gotet Quote
Draco18s Posted August 11, 2020 Posted August 11, 2020 57 minutes ago, gotet said: Yeah, got it! Yep, definitely changed and a lot. Didn't really expect that, but I knew the process that I'd use to locate the relevant bit of code. That is, I knew BlockColors was involved and that something got registered. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Recommended Posts
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.