// -- Our rendering process for each room -- // 1. Activate Scissor rectangle for Room bounds // 2. Fill room black // 3. For each light: // 3a. Scissor reapplies to room intersect light bounds // 3b. Generate wall shadow map for light. // 3c. Generate object shadow map for light. // 3d. Additive blend light onto room lightmap texture, using room map limit shader // 4. If outdoors, apply outdoors light: // 4a. Scissor reapplies to room bounds again // 4b. Generate wall shadow map for light. (with gradient falloff, fixed direction) // 4c. Generate object shadow map for light. (fixed shadow direction and height) // 4d. Additive blend light onto room lightmap texture, using room map limit shader // Room map textures currently: // (second optional, requires floating point surface format) // RGBA: RGB, ShadIntensity // HalfVec2: DirX, DirY // ShadIntensity is the average of RGB modified by object floor shadows. // Factor is reapplied: // - On floors // - On the bottom of walls //alternate // RGBA: LightIntensity, OutdoorsIntensity, LightIntensityShad, OutdoorsIntensityShad // HalfVec4: DirX, DirY, DirXShad, DirYShad (directional component enabled) public LMapBatch(GraphicsDevice device, int res) { GD = device; targetResPerTile = res; this.GradEffect = WorldContent.Grad2DEffect; this.LightEffect = WorldContent.Light2DEffect; InitBasicData(); }
public static void LoadEffects(bool reload) { _2DWorldBatchEffect = new WorldBatchEffect(ContentManager.Load <Effect>("Effects/2DWorldBatch" + EffectSuffix)); Grad2DEffect = new GradEffect(ContentManager.Load <Effect>("Effects/gradpoly2D")); Light2DEffect = new LightMap2DEffect(ContentManager.Load <Effect>("Effects/LightMap2D")); GrassEffect = new GrassEffect(ContentManager.Load <Effect>("Effects/GrassShader" + EffectSuffix)); RCObject = new RCObjectEffect(ContentManager.Load <Effect>("Effects/RCObject" + EffectSuffix)); SSAA = ContentManager.Load <Effect>("Effects/SSAA"); SpriteEffect = new Effects.SpriteEffect(ContentManager.Load <Effect>("Effects/SpriteEffects" + EffectSuffix)); ParticleEffect = new LightMappedEffect(ContentManager.Load <Effect>("Effects/ParticleShader")); AvatarEffect = new LightMappedEffect(ContentManager.Load <Effect>("Effects/Vitaboy" + EffectSuffix)); Files.RC.Utils.DepthTreatment.SpriteEffect = SpriteEffect; LightEffects = new List <LightMappedEffect>() { _2DWorldBatchEffect, GrassEffect, RCObject, ParticleEffect, AvatarEffect }; }