I'm currently trying to apply shade relief effect to dem raster layer(geotiff format, one band with float samples, min and max are around 77 and 100) using geotools. I've tried diffrent parameters setups (factor and brigthness only flag), but effects are not even noticable. I'm wondering if it's my fault or this feature isn't implemented. I don't want to use gdal because I'd like to keep dem samples unchanged. I'm attaching code sample used to generate style applied to dem layer.
StyleFactory sf = CommonFactoryFinder.getStyleFactory(null);
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
ContrastEnhancement ce = sf.contrastEnhancement(ff.literal(1.0), ContrastMethod.EXPONENTIAL);
SelectedChannelType sct = sf.createSelectedChannelType(String.valueOf(1), ce);
RasterSymbolizer sym = sf.getDefaultRasterSymbolizer();
ChannelSelection sel = sf.channelSelection(sct);
sym.setChannelSelection(sel);
sym.setColorMap(cm.build());
sym.setShadedRelief(new ShadedReliefBuilder().factor(22).brightnessOnly(true).build());
Style style = SLD.wrapSymbolizers(sym);