.. | .. |
---|
134 | 134 | |
---|
135 | 135 | try |
---|
136 | 136 | { |
---|
137 | | - BufferedImage image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
138 | | - |
---|
| 137 | + BufferedImage image; |
---|
| 138 | + |
---|
| 139 | + if (name.endsWith("jpg")) |
---|
| 140 | + // Much faster! |
---|
| 141 | + image = new sun.awt.image.codec.JPEGImageDecoderImpl(ObjEditor.class.getClassLoader().getResourceAsStream(name)).decodeAsBufferedImage(); |
---|
| 142 | + else |
---|
| 143 | + image = javax.imageio.ImageIO.read(ObjEditor.class.getClassLoader().getResourceAsStream(name)); |
---|
| 144 | + |
---|
139 | 145 | // if (image.getWidth() > 48 && image.getHeight() > 48) |
---|
140 | 146 | // { |
---|
141 | 147 | // BufferedImage resized = new BufferedImage(48, 48, image.getType()); |
---|
.. | .. |
---|
2364 | 2370 | { |
---|
2365 | 2371 | public void mouseClicked(MouseEvent e) |
---|
2366 | 2372 | { |
---|
2367 | | - borderfadeField.setFloat(0.5); |
---|
| 2373 | + borderfadeField.setFloat(0.4); |
---|
2368 | 2374 | opacityField.setFloat(0.75); |
---|
2369 | 2375 | |
---|
2370 | 2376 | materialtouched = true; |
---|
.. | .. |
---|
2430 | 2436 | } |
---|
2431 | 2437 | }); |
---|
2432 | 2438 | presetpanel.add(shadowShader); |
---|
| 2439 | + |
---|
| 2440 | + cLabel para0 = GetLabel("icons/shadericons/parallax0.png", !Globals.NIMBUSLAF); |
---|
| 2441 | + para0.setToolTipText("No parallax"); |
---|
| 2442 | + para0.addMouseListener(new MouseAdapter() |
---|
| 2443 | + { |
---|
| 2444 | + public void mouseClicked(MouseEvent e) |
---|
| 2445 | + { |
---|
| 2446 | + parallaxField.setFloat(0.125); |
---|
| 2447 | + |
---|
| 2448 | + materialtouched = true; |
---|
| 2449 | + applySelf(); |
---|
| 2450 | + } |
---|
| 2451 | + }); |
---|
| 2452 | + presetpanel.add(para0); |
---|
| 2453 | + |
---|
| 2454 | + cLabel para1 = GetLabel("icons/shadericons/parallax1.png", !Globals.NIMBUSLAF); |
---|
| 2455 | + para1.setToolTipText("With parallax"); |
---|
| 2456 | + para1.addMouseListener(new MouseAdapter() |
---|
| 2457 | + { |
---|
| 2458 | + public void mouseClicked(MouseEvent e) |
---|
| 2459 | + { |
---|
| 2460 | + parallaxField.setFloat(0.13); |
---|
| 2461 | + |
---|
| 2462 | + materialtouched = true; |
---|
| 2463 | + applySelf(); |
---|
| 2464 | + } |
---|
| 2465 | + }); |
---|
| 2466 | + presetpanel.add(para1); |
---|
| 2467 | + |
---|
| 2468 | + cLabel para2 = GetLabel("icons/shadericons/parallax2.png", !Globals.NIMBUSLAF); |
---|
| 2469 | + para2.setToolTipText("Reset parallax"); |
---|
| 2470 | + para2.addMouseListener(new MouseAdapter() |
---|
| 2471 | + { |
---|
| 2472 | + public void mouseClicked(MouseEvent e) |
---|
| 2473 | + { |
---|
| 2474 | + parallaxField.setFloat(0.14); |
---|
| 2475 | + |
---|
| 2476 | + materialtouched = true; |
---|
| 2477 | + applySelf(); |
---|
| 2478 | + } |
---|
| 2479 | + }); |
---|
| 2480 | + presetpanel.add(para2); |
---|
2433 | 2481 | |
---|
2434 | 2482 | cGridBag panel = new cGridBag().setVertical(true); |
---|
2435 | 2483 | |
---|
.. | .. |
---|
2676 | 2724 | backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints); |
---|
2677 | 2725 | colorSection.add(backlit); |
---|
2678 | 2726 | |
---|
| 2727 | + cGridBag parallax = new cGridBag(); |
---|
| 2728 | + parallax.add(parallaxLabel = new JLabel("Parallax")); // , aConstraints); |
---|
| 2729 | + parallaxLabel.setHorizontalAlignment(SwingConstants.TRAILING); |
---|
| 2730 | + parallax.add(parallaxField = new cNumberSlider(this, 0.001, 0.25, -0.125)); // , aConstraints); |
---|
| 2731 | + colorSection.add(parallax); |
---|
| 2732 | + |
---|
2679 | 2733 | //panel.add(new JSeparator()); |
---|
2680 | 2734 | |
---|
2681 | 2735 | //panel.add(globalSection); |
---|
.. | .. |
---|
3727 | 3781 | shadowField.setFloat(mat.shadow); |
---|
3728 | 3782 | textureField.setFloat(mat.texture); |
---|
3729 | 3783 | opacityField.setFloat(mat.opacity); |
---|
| 3784 | + parallaxField.setFloat(mat.parallax + 0.125f); |
---|
3730 | 3785 | fakedepthField.setFloat(mat.fakedepth); |
---|
3731 | 3786 | shadowbiasField.setFloat(mat.shadowbias); |
---|
3732 | 3787 | bumpField.setInteger(1); // dec 2013 |
---|
.. | .. |
---|
4951 | 5006 | current.shadow = (float) shadowField.getFloat(); |
---|
4952 | 5007 | current.texture = (float) textureField.getFloat(); |
---|
4953 | 5008 | current.opacity = (float) opacityField.getFloat(); |
---|
| 5009 | + current.parallax = (float) parallaxField.getFloat() - 0.125f; |
---|
4954 | 5010 | current.fakedepth = (float) fakedepthField.getFloat(); |
---|
4955 | 5011 | current.shadowbias = (float) shadowbiasField.getFloat(); |
---|
4956 | 5012 | |
---|
.. | .. |
---|
5005 | 5061 | textureField.SetToolTipValue((mat.texture)); |
---|
5006 | 5062 | if (!Equal(opacityField.getFloat(), mat.opacity)) |
---|
5007 | 5063 | opacityField.SetToolTipValue((mat.opacity)); |
---|
| 5064 | + //if (!Equal(parallaxField.getFloat(), mat.parallax)) |
---|
| 5065 | + parallaxField.SetToolTipValue((mat.parallax)); |
---|
5008 | 5066 | if (!Equal(fakedepthField.getFloat(), mat.fakedepth)) |
---|
5009 | 5067 | fakedepthField.SetToolTipValue((mat.fakedepth)); |
---|
5010 | 5068 | if (!Equal(shadowbiasField.getFloat(), mat.shadowbias)) |
---|
.. | .. |
---|
6261 | 6319 | cNumberSlider textureField; |
---|
6262 | 6320 | JLabel opacityLabel; |
---|
6263 | 6321 | cNumberSlider opacityField; |
---|
| 6322 | + JLabel parallaxLabel; |
---|
| 6323 | + cNumberSlider parallaxField; |
---|
6264 | 6324 | JLabel fakedepthLabel; |
---|
6265 | 6325 | cNumberSlider fakedepthField; |
---|
6266 | 6326 | JLabel shadowbiasLabel; |
---|