Loading...
 

Rendering-Lighting-Effects

------------------
(result) 62K Collada spots (transform matrix)
(compare) 62K Radiant spots (regex'd strings)
(target) MAP file to process (rotation matrix)

- decimate floating-point accuracy (4 decimals)
- strip, clean and align (single-line)
- regex to string-format below (hooks)
- match closest string from "compare" list (agrep-fuzzy)
- compile converted files together
- translate "target" to output via "result"
- assemble collada file

(priorities for pattern matching):-
First decimal place = 0-9
2nd & 3rd decimal = upper case
4th,5th,6th decimal = lower case

1234567890
BDFHJLNPRT

1234567890
adgilortwz

NLNLLlll
0.876562 = 0.8NLlod
...
------------------
...(light-sphere creation for Radiant/Blender):
roll = +15x24 = 360 (24)
(copy)
pitch = +180 (24=48) (to mirror)
(copy)
pitch = +5x17 = 90 (34x48=1632)
(copy)
pitch = +90 (3264)
(copy)
yaw = +5x31 (101,164) /2+x = ~62,000

(optional):
(redo top and bottom 4 rings (orbit-wise):-
20 15 10 10 5 5 5 5 5 5 5 (-1000~)

.
.
.

.
.
.

_

Lights are to be categorised by the following technical considerations:-
1). Dynamic spot/real-time shadows.
2). Dynamic point/real-time shadows.
3). Lightmap spot/baked shadows.
4). Lightmap point/baked shadows.
5). Irradiance volume point.

...spotlight values:-
"Name/Origin/Color"
- self-explanatory and directly translated, can be anything.
"Noshadows"
- translates to "CastShadows" (NA) and "Shadows" (B).
"Target"
- this determines how "long" your spotlight beam will be.
- translates to "Attenuation Far" (NA) and "Distance Falloff" (B). The largest of these values will be used. (*only for Z axis)
"Right/Up"
- this determines the angle of your spotlight beam. (*note: angle of beam cone only, not angle for the light itself!)
- translates to "SpotlightOuterAngle" (NA) and "Size" of "Spot Shape" (B). Only largest value used.
"Texture"
- what image to cast from the spotlight. Mainly used by the lightmap but might be further translated later.
- not supported by the NeoAxis engine.
"Overbright"
- custom value not used by Radiant.
- translates to "Diffuse Power" (NA)(x1) and "Energy" (B)(x10).
"Rotation"
- is very strictly translated. You must use lights from the "spots.map" and use those exact coords,
- otherwise your spotlight will not face that direction in Blender or NeoAxis. (*0.707107)

...pointlight values:-
"Name/Origin/Color"
- self-explanatory and directly translated, can be anything.
"Noshadows"
- translates to "CastShadows" (NA) and "Shadows" (B).
"Overbright"
- custom value not used by Radiant but translates to "Diffuse Power" (NA)(x1) and "Energy" (B)(x10).
"Radius"
- size of the point light, translates to "Attenuation Far" (NA) and "Distance Falloff" (B). Only largest value used.
.
.
.

The texture must be used to orientate how it would otherwise be projected onto a surface. The perpendicular rotation of the spotlight is not taken into consideration and any orientation must be that of the texture, not the light itself.
Light projected textures come in either 1 variation (mirrored X and Y), 2 variations (mirrored X or Y) or 4 variations (no mirroring), to give 90' angles as options for orientation. Custom lightshaders can always be added and won't use too much texture memory anyway.

- Target, Right and Up values can't have decimals, must be whole integers. A decimal may be confused as the largest value.

.
.
.





_

Light exporting & standards
_

As I'm getting closer to finalising the GAWK/Regex scripts to translate lights from Radiant-to-Blender-to-'Engine(s)' (and back again, possibly), I thought it's time to talk about what to expect from this, and exactly how the projects will ultimately use lights. There is a standard, but like everything else, it's all scalable. The exact methods and scales used will depend on each mapper, so this is all important to understand from the outset. Also to temper your expectations, because at every step of the way you will lose precision and with much requiring re-tweaking. Some things will need to be manually done altogether. However, the fact that this is even possible at all should be appreciated, and at least you'll get _something_ to work with.

The lighting roughly breaks down into these overall categories:-
- Dynamic lights with shadows and animated shaders. (*almost always spot-lights)
- Dynamic lights (as filler) that don't cast shadows or animate. (*almost always point-lights)
- Irradiance volume baked in the engine. (*corresponding to the lightmap)
- Lightmaps (textures) baked from Blender.

At a higher setting, the first and second category can be expanded with extra 'secondary' lights and their effects, so a greater number of real-time shadows can also be present. This won't really affect the baked lightmaps, because they too can receive shadows and be 'overridden' by them, so real-time lights and baked lightmaps are, for the most part, playing nicely with each other. The baked lightmaps themselves can reach up to 32K in resolution. Whether this will be a light option or texture option, or both, is yet to be decided. A higher setting may also include extra lights in events like explosions, etc. Right now there are only 3 settings-levels, but that really should be plenty.

The issue is, in terms of compatibility in the translation process - currently in Radiant, we're dealing with cubic light volumes that use a texture of a circle to give the illusion of a spherical light volume. In Blender, the lights are spherical and you can only achieve a cubic volume with 6 area lights stuck together. This is impossible to set up for every light, so essentially we have no choice but to adapt what is exported to spherical volumes. This means that the textures/shaders used for lights in Radiant will not perfectly match what is seen in Blender, and from Blender to the engine. Essentially, Radiant it fitting a circle into a square, and Blender is trying to fit a square into a circle - that's the best I can explain it. Blender also takes the viewpoint into account with each light, and attempts to treat them as real-world lights as opposed to Radiant which just blobs illumination onto a surface which is contacting the volume. It's too technical for me to explain properly, you'll just need to wait until you see it for yourself. Lights in Blender tend to streak across surfaces based on a viewpoint, more like real-world lights. I can confidently say, this will never ever be fixed as to be perfectly compatible. After all, in the final-target engine(s) using PBR materials, this discrepancy would be even more profound, as surface-angles catch and streak light across themselves, depending on material.

A quick note about 'irradiance volume' - this is a technique that attempts to cast simple (vertex) lighting from the lightmap. It's very cheap, but the trade-off is that only a certain amount of lights in a given area (called 'cells') can be calculated. The more cells, the longer the compile times and lower the performance. This will only light dynamic objects like players and physics, given that anything else would be static and share the local lightmap. A compact matrix that would account for every light is just impossible. So, the huge concern about irradiance volumes is that it won't intelligently pick which lights get culled from the process, I suppose it just takes them as they're ordered in the map. A mapper will need to manually guess the cell-size and number of lights, and disperse them as needed. A practical example of this is some trim-light where you've got a lot of point-lights in a row, to simulate an illuminated-surface trim-light. It will do the first 3 and just cull the rest until the next cell is reached, resulting in batches of lights between gaps. What you really want is every other (or Nth) light, so even if the result is not as fine as you'd hoped for, at least it is even and consistent, and unfortunately, this can only be achieved manually.

So, I hope that covers enough to provide understanding and hone your expectations. It's never going to be perfect, but at least for me, even with the quirks, I'm really stoked this is even remotely possible at all...

https://www.violationentertainment.com/wiki/tiki-index.php?page=Lighting-Tutoriallink-external

.
.
.

========
========
========
> light type (point/spot).
> coords.
> rotation (basic 90').
> light colour.
> light intensity.
> light size.(radius)
> spot shape.(radius)
> spot distance.(cutOffAngle)
> spot blend.(beamWidth)
> texture.
...

========
Radiant-to-Blender:-
--------
- Delete everything but light entities.
- Save copy of .map file.
- Translate.
...

========
Blender-to-NeoAxis:-
--------
- Make sure you use 'Blender Render' renderer.
- Delete everything but lights.
- Scale 64 from 0,0,0.
- Export to 'X3D' from 2.72.
- Translate.
...

========
NeoAxis-to-Blender:-
--------
- Delete everything but lights.
- Save copy of .map file.
- Translate.
...

========
Blender-to-Radiant:-
--------
- Make sure you use 'Blender Render' renderer.
- Delete everything but lights.
- Export to 'X3D' from 2.72.
- Translate.
...
.
.
.

=======
World:-
-----------
- Blender Render (Internal)
- Horizon & Ambient: #080808
- Gather: Approximate
- Passes: 3
...

=======
GI:-
-----------
- Indirect Lighting enabled
- (toy and test normalmaps?)
- Factor: 1.27 / Bounces: 27
- Gather: Approximate
- Attenuation: Falloff: 0.27
- Passes: 7 / Error: 0.1
- Pixel Cache: Correction: 0.4
...

=======
Light:-
-----------
- Energy: ~24-32
- Falloff: Lin/Quad / Distance: ~1-7 / Gamma: 1.0
- Attenuation: Linear: 0 / Quadratic: 1 (fully soft)
- Spot Shape: 77' / Blend: 1.0
...

=======
Shadow (Light tab):-
-----------
- Ray Shadow
- Colour: #080808
- Sampling: 32
- Soft: 3.0
- Constant QMC
...

=======
Projection (Texture tab):-
-----------
- Extension: Clip
- Coordinates: Global (Offset/Size for position)
- Influence: Colour: 1.0 / Shadow: disabled
- Blend: Subtract (black fg on white bg) (Negative: enabled)
...

=======
Mesh emission (Material tab):-
-----------
- Intensity: Diffuse: 1.0 / Specular: 0.0
- Shading: Emit: ~32
- Transparency: Z Transparency: Alpha: 0.0
- Traceable: disabled / Face Textures: enabled / Use Mist: disabled
- Shadow: disable all except 'Cast Approximate'
...

.
.
.

=======
Lightmap baking:-
-----------
- Add "lightmap" channel to UV Maps (and unwrap)
- Add "lightmap" texture to main material (new image: 8192*)(/16384*)
- Mapping: Coordinates: UV: "Lightmap"
- Influence: Blend: Overlay
- Set Diffuse color to full-black
- Select all UVs in "UV/Image Editor"
- Bake: Margin: 22
...

=======
AO baking (1st pass):-
-----------
- Set all to 1 default material and assign
- Disable "Double Sided" on mesh
- Set diffuse to half gray and full intensity
- Enable "Tangent Shading" & "Cubic Interpolation"
- Ambient Occlusion: Factor: 2.8
- Gather: Raytrace:-
- Attenuation: Distance: 0.8
- Falloff: Strength: 4
- Sampling: Constant Jittered
- Samples: 96 / Bias: 0.4
-----------
AO baking (2nd pass):-
-----------
- Set all to 1 default material and assign
- Disable "Double Sided" on mesh
- Set diffuse to full white and 0.01 intensity
- Enable "Tangent Shading" & "Cubic Interpolation"
- Ambient Occlusion: Factor: 99
- Gather: Raytrace:-
- Attenuation: Distance: 77
- Falloff: Strength: 0.7
- Sampling: Constant Jittered
- Samples: 48 / Bias: 0.5
-----------
AO composite:-
-----------
- Invert 2nd pass and subtract from 1st pass
- Luminence 99, invert, blur and use as mask
- Contrast -33 and brightness 33
- Delete mask - contrast 54 and brightness -4
...

.
.
.





SSAO - 1.35/1.00/1.77/0.03/0.03/256/1
LDRBloom - 0.87 / 4.20
ColorCorrection - 0.93/0.93/0.93
MotionBlur - 0.11
RadialBlur - 0.50 / 0.50 / 0.01
Vignetting - 10.00 / 0.32