File information

Last updated

Original upload

Created by

scanti

Uploaded by

scanti

Virus scan

Safe to use

About this mod

This is an OBSE plug-in that allows you to switch between severel different night eye shaders while the game is running.

Permissions and credits
Mirrors
Name: SwitchNightEyeShaders
Version: 5.0
Date: 13 September 2008
Category: Modders Resource
Requirements: Oblivion Script Extender (OBSE) version 13 or greater, Oblivion version 1.2.0.416
Author(s): scanti
Source:

Description
===========

This is an OBSE plug-in that allows you to add your own nighteye shaders and swap them at will during the game.

Any shaders you create must be in the pso file format and be placed in the data\shaders\nighteye folder and the data\shaders\hdr.nighteye folder. Each shader must have 2 versions. One normal shader in the data\shaders\nighteye folder and another for when the game is using HDR in the data\shaders\hdr.nighteye folder.
(If you miss out the hdr version of the shader and the player is using hdr then the screen will black-out or white-out while night eye is active).

To create the shader files you can use the Oblivion shader editor utility by Timeslip. http://timeslip.chorrol.com/

I've also added a HLSL shader development system. Write your shader in HLSL, name it <shader name>.hlsl and place it in the data\shaders\dev.nighteye folder.<br><br>When you next start the game the game will compile your hlsl shader and place it in either the data\shaders\dev.nighteye folder or the data\shaders\hdr.dev.nighteye folder depending on whether you have hdr enabled or not. This shader will get added to the game's shader list you can get it's enumeration by using the AddNightEyeShader "<shader name>.hlsl" command. Note you must end the filename with hlsl, not pso for it to find the shader.<br><br>Once you are happy with your shader you can copy the compiled pso file into both the data\shaders\nighteye and the data\shaders\hdr.nighteye folders.<br><br>The plug-in adds 2 new commands:<br><br>AddNightEyeShader and SetNightEyeShader.<br><br>To try out the plug-in I've included some shaders that were created by Timeslip. To switch between them go into the command console and type in SetNightEyeShader followed by a value between 0 and 16 and then activate night eye. You can switch between shaders while night eye is still active.<br><br>From version 5 of the plug-in you can have multiple nighteye effects active.<br><br><br>Commands<br>========<br><br><shader number> EnumNightEyeShader <filename of shader><br><br>Will find the shader associated with the shader filename and return a value you can use with SetNightEyeShader to switch to that shader. The filename must have the .pso extension. The filename must not exceed 100 characters or you will cause Oblivion to crash. (Was previously AddNightEyeShader, although you can still use that command as an alias).<br><br><br>SetNightEyeShader <shader number> <optional active type><br><br>This allows you to deactivate, activate a shader or add a night eye shader to the night eye effect list. Shader number 0 is always the default Oblivion shader.<br><br>The Active Type is a number from 0 to 3:<br><br>0 - Set the shader to always be deactivated.<br>1 - Set the shader to always be active regardless of whether the nighteye effect is active or not.<br>2 - Adds the shader to the nighteye shader list. Whenever the nighteye effect is active then the shader will become active.<br>3 - (Default) Sets the shader to be the only one activated by the nighteye effect. This is the behaviour of the shaders before version 5 of the plug-in.<br><br>Writing HLSL shaders<br>====================<br><br>There are a couple of guidelines to follow in writing a HLSL shader for the nighteye effect.<br><br>The screen texture is passed into the shader as Src0 and you must use the line:<br><br>samper2D Src0<br><br>The main function that gets called by the pixel shader must be called main i.e.<br><br>float4 main( float2 Tex : TEXCOORD0 ) : COLOR0<br><br>I've set the compiler target to pixel shader version 2.0. If you need to compile to a later version then let me know and I'll add an option to allow you to set what version the shader compiler compiles to but ps 2.0 should be good enough for most people.<br><br>Install<br>=======<br><br>1. Extract the files to a temporary location.<br>2. Examine the folder structure and make corrections where necessary.<br>3. Copy files in the data folder to (install folder)\Oblivion\Data\<br>4. You need to start Oblivion with the OBSE laucher for the plug-in to work.<br><br>(The files in the src folder contain the source code for the plug-in. If you aren't interested in it or don't<br>know what source code is then just ignore it).<br><br>Uninstall<br>=========<br><br>1. Delete the files/folders associated with the mod.<br><br>Oblivion\Data\Shaders\NightEye<br>Oblivion\Data\Shaders\hdr.NightEye<br>Oblivion\Data\Shaders\dev.nighteye<br>Oblivion\Data\Shaders\hdr.dev.nighteye<br>Oblivion\Data\obse\plugins\SwitchNightEyeShader.dll<br><br><br>Upgrade<br>=======<br><br>1. Delete any files that begin with "hdr." in the Oblivion\Data\Shaders\Nighteye folder.<br>2. Copy the newer files into the oblivion folders as normal. If windows asks if you want to replace a file then answer yes.<br><br><br>History<br>=======<br><br>5.0, 13 September 2008 - You can now have multiple night eye shaders active.<br>4.0, 05 September 2008 - Fixed bug that caused HLSL shaders not to compile when an older pso existed.<br><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span> Changed the compilation target from ps 1.3 to ps 2.0.<br><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span> Added some example HLSL shaders.<br>3.0, 01 September 2008 - Fixed bug with shaders showing up white in hdr mode.<br><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span><span class="wbbtab"></span> Added a HLSL shader development mode.<br>2.0, 30 August 2008 - Fixed bug that stop commands being registered in the construction set.<br>1.0, 29 August 2008 - Initial release.<br><br>Contact<br>=======<br><br>You can find me on the official Elder Scrolls forums as 'scanti'<br>You can find me on TESNexus as 'scanti'<br><br>Credits<br>=======<br><br>Thanks to the OBSE team for creating such a wonderful program and adding plugin support.<br>Thanks to Bethesda for creating Oblivion.<br>Thanks to TESNexus.com for the a one-stop-shop resource for authors and players.<br>Thanks to LHammonds for the Readme Generator this file was based on.<br>Thanks to Timeslip for letting me use his replacement night eye shaders as an example.<br><br>Licensing/Legal<br>===============<br><br>As with all my mods you can do whatever you want with this mod. If you do use it then a mention would be nice.<br></optional></shader></filename></shader></shader></shader>