Posted August 10, 20205 yr 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, 20205 yr by gotet
August 10, 20205 yr 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, 20205 yr by Draco18s 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.
August 10, 20205 yr Author When I searched in eclipse in version 1.16.1-32.0.108, I only found one file containing "colormultiplier": output.srg.
August 10, 20205 yr 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. 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.
August 11, 20205 yr Author Hm, I dont even know how to search for the text 16777216. File search in eclipse seems broken.
August 11, 20205 yr 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. 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.
August 11, 20205 yr Author 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); } }
August 11, 20205 yr 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. 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.
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.