Skyrim
0 of 0

File information

Last updated

Original upload

Created by

scegielski

Uploaded by

scegielski

Virus scan

Safe to use

Tags for this mod

About this mod

For ENB preset developers, code tweakers, and enthusiasts. Shader functions for ENB that allow drawing of text as an overlay on the game screen for debug or other purposes. No more guessing at what your variable values are. For example, show the values of the _c registers, colors, etc. Use with your own variables too. Add titles to your pr

Permissions and credits
Important Message
This is not a full ENB preset. It only replaces the enbeffect.fx file that is part of presets and the standard ENB distribution and adds another file EnhancedENBDiagnostics.fxh. Either an ENB preset or the standard ENB distribution from www.enbedev.com need to be installed first.Thanks!



Videos:


Demo and Installation




Version History:



1.0


-Converted functions from drawtext.frag GLSL shader
-Added convenience functions:
-EED_drawText
-EED_drawFloatText
-EED_drawCRegisterText
-EED_drawCRegistersText
-EED_drawColorText
-EED_drawTitleText
(see below for function descriptions)

-Added annotation and implementation code in enbeffect.fx to demo convenience functions



Installation:


See the video for installation instructions.Quick installation:
1. Backup existing enbeffect.fx file in game folder
2. Copy contents of downloaded .7z into game folder
3. Run game
4. Press <Shift><Enter> to open ENB interface
5. Turn on Enhaced Enb Diagnostics in the ENB "Shader Window"



Description:


Coding for enb can be a fun process. Debugging, not so much.Luckily, the introduction of annotation gui controls allowed easier input debugging.However, as far as I know, there is no good way to get output for debugging. So, as I currently am dealing with this issue while developing my Enhanced ENB Night Eye mod, I decided to try and make the situation better for myself and hopefully for all developers.I had a hunch that someone also faced this same issue, and a quick Google search turned up almost exactly what I wanted at:

http://mew.cx/drawtext/drawtext.html

So thanks to Michael E. Weiblen at the site above, all of the most difficult the leg work was already done.All I had to do was convert his GLSL code into HLSL which was the most part (except where noted in the file) was straight forward. I then worked on it for a bit more and added some basic functions that would be useful to me as an ENB shader developer.Take a look at the video at the top for more information and a demo.



Features:


* Draw ENB debugging text as game overlay!

* When using the default included enbeffect.fx file, enabling the mod in the in the game shader window will draw the following text:
- Title
- RGB color value at specified location in screen uv coordinates
- _c1 thru _c5 game registers
- ENB Timer.x variable

* Includes header file EnhancedENBDiagnostics.fxh
Developers can use the functions in the header file to draw their own text. The first thing to do is to add an #include statement to the header file in the file in which you want to use the functions.For example, if you are working on enbeffect.fx, you can add the following line to the top of the file:

#include "EnhancedENBDiagnostics.fxh"

After that is done, you can then call any of the EED_ prefixed functions.All of these functions return a color in a float4 variable so all you need to do is add the result of the function to the final color.Usually this is a variable named "_C0" but might have another variable that is used before that like "color".See the included enbeffect.fx file for how to do this.

Note about ascii values:So unfortunately coding your own text is a little tedious because, as far as I know, the HLSL shading language has no string or char types.So we are stuck adding our text one argument at a time by finding each character's decimal code in the included ascii table.If someone knows of a better way, please let me know. But the labeling is secondary in my opinion, the real win here is seeing the values!



[header]Functions[/header]
Below I am including the current convenience/wrapper functions that I added and their descriptions.They are included as they appear in the EnhancedENBDiagnostics.fxh file.


///////////////////////////////////////////////////////////////////////////////
// EED_drawText:
// Draws 16 ascii chars of text contained in the .xyzw components
// of txt1 and txt2. See ascii table at end of file for character
// values.txCoords should be unmodified and set position
// and size using uvPosition and size args.
float4 EED_drawText(float4 txt1, float4 txt2, float4 txt3, float4 txt4,
float2 txCoords, float2 uvPosition, float size)

///////////////////////////////////////////////////////////////////////////////
// EED_drawFloatText:
// Draws 8 ascii chars of text contained in the .xyzw components
// of txt1 and txt2.txCoords should be unmodified and set position
// amnd size using uvPosition and size args.Precision is where the
// drawing cutoff is, not actual precision.
float4 EED_drawFloatText(float4 txt1, float4 txt2, float val, float2 txCoords,
float2 uvPosition, float size, int precision)

///////////////////////////////////////////////////////////////////////////////
// EED_drawCRegisterText:
// Draws one of the _c register variables.
float4 EED_drawCRegisterText(float2 registerCoords, float4 _c, int cNumAscii, int precision)

///////////////////////////////////////////////////////////////////////////////
// EED_drawCRegistersText:
// Draws the external register values.Can only be used where available
// such as in enbeffect.fx in whiach the variables are defined like this:
//
// //skyrim shader specific externals, do not modify
// float4_c1 : register(c1);
// float4_c2 : register(c2);
// float4_c3 : register(c3);
// float4_c4 : register(c4);
// float4_c5 : register(c5);
//
// Example call from enbeffect.fx:
//
//color.xyz += EED_drawCRegistersText(_c1, _c2, _c3, _c4, _c5,
//IN.txcoord0, float2(0.9, 0.2), 0.9, 5);
//
float4 EED_drawCRegistersText(float4 _c1, float4 _c2, float4 _c3, float4 _c4, float4 _c5,
float2 registerTxCoords, float2 uvPosition, float size, int precision)

///////////////////////////////////////////////////////////////////////////////
// EED_drawColorText
// Draws text for a RGBA color variable.
//
float4 EED_drawColorText(float4 color, float2 colorTxCoords, float2 uvPosition, float size, int precision)

///////////////////////////////////////////////////////////////////////////
// EED_drawTitleText
// Draw Title text by assigning values in arrays using ASCII reference
// table below.





Future Development


-Better color display (swatch, hsv, no alpha, etc.)
-Fading title based on Timer.x variable
-Other font texture (please help)
-Open to ideas.Please add suggestions in the forum.



Permission Notes


Use and distribute freely but please keep the original from credits drawtext.frag within the EnhancedENBDiagnostics.fhx file intact.If you are displaying text on the screen using my functions as part of your mod, please display my title as part of the text you are displaying by running the function EED_drawTitleText() as demonstrated in the included enbeffect.fx file. It can be moved, sized, and or faded. Thanks.



Credits


Boris Vorontsov for ENB
www.enbdev.com

Michael E. Weiblen
drawtext.frag GLSL shader and texture
http://mew.cx/drawtext/drawtext.html



My Other Mod


Enhanced ENB Night Eye
http://www.nexusmods.com/skyrim/mods/50731