Get full existing shader function working on HDMap
This commit is contained in:
parent
f3f871df3c
commit
1f2722b249
7 changed files with 527 additions and 156 deletions
40
src/main/java/org/dynmap/hdmap/HDShaderState.java
Normal file
40
src/main/java/org/dynmap/hdmap/HDShaderState.java
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package org.dynmap.hdmap;
|
||||
|
||||
import org.dynmap.Color;
|
||||
import org.dynmap.utils.MapChunkCache;
|
||||
import org.dynmap.utils.MapIterator;
|
||||
|
||||
/**
|
||||
* This interface is used to define the operational state of a renderer during raytracing
|
||||
* All method should be considered performance critical
|
||||
*/
|
||||
public interface HDShaderState {
|
||||
/**
|
||||
* Reset renderer state for new ray - passes in pixel coordinate for ray
|
||||
*/
|
||||
void reset(int x, int y);
|
||||
/**
|
||||
* Process next ray step - called for each block on route
|
||||
* @param blocktype - block type of current block
|
||||
* @param blockdata - data nibble of current block
|
||||
* @param skylightlevel - sky light level of previous block (surface on current block)
|
||||
* @param emittedlightlevel - emitted light level of previous block (surface on current block)
|
||||
* @param laststep - direction of last step
|
||||
* @return true if ray is done, false if ray needs to continue
|
||||
*/
|
||||
boolean processBlock(int blocktype, int blockdata, int skylightlevel, int emittedlightlevel, HDMap.BlockStep laststep);
|
||||
/**
|
||||
* Ray ended - used to report that ray has exited map (called if renderer has not reported complete)
|
||||
*/
|
||||
void rayFinished();
|
||||
/**
|
||||
* Get result color - get resulting color for ray
|
||||
* @param c - object to store color value in
|
||||
* @param index - index of color to request (renderer specific - 0=default, 1=day for night/day renderer
|
||||
*/
|
||||
void getRayColor(Color c, int index);
|
||||
/**
|
||||
* Clean up state object - called after last ray completed
|
||||
*/
|
||||
void cleanup();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue