View Full Version : Feature Request Scriptable custom textured background

Jul 13, 2018, 01:11 PM
Well, the title says it all. Just ignore it if I'm asking something that can't be done or not worth the effort.

Jul 15, 2018, 09:36 AM
It would be useful if you expand a bit on what 'scripted' means in this context. If you mean a fully customizable texture distortion effect, a la shaders, that would probably require some major changes to the rendering pipeline, and is therefore a lot of work. But if you want to change a relatively limited set of parameters (like speed and fade colours are parameters you can tweak now), that could be easier to implement. In that case it would help if you described the kind of parameter you'd like to change, though.

Jul 17, 2018, 07:31 AM
What I meant was the former one you described: being able to script what shape the textured background takes. No special effects like blur, glowing and the like, though.

Jul 17, 2018, 08:09 AM
How do you imagine the API for that? What new classes or functions would you want to be added? Can you post a snippet of code showing sample use and its intended effect?

Jul 17, 2018, 12:06 PM
Unfortunately I can't give answers to your questions, because I'm not familiar with any of this stuff. It was just an idea, it's your decision whether you implement it and how you do it. Please don't take it as a demand.

Violet CLM
Jul 17, 2018, 01:03 PM
The point of the questions is trying to figure out what your idea is.

Jul 19, 2018, 07:17 AM
Well, the idea I have doesn't involve scripting only and could be used by anyone less familiar with AS. It's about drawing a heightmap with given image resolutions, which would determine the "shape" of the background itself, and the orientation of that shape could be manipulated in the script. I'm thinking of properties like zoom, stretch, rotation on different axes and mirroring (copies the shape and renders it on the opposite side of the center point).

EDIT: code for warp horizon in vertical orientation would be something like this:


customBG.loadHeightmap("heightmapExample.png"); //loads a heightmap. using a flat shape for this example
customBG.zoom = 0;
customBG.stretchX = 0; //
customBG.stretchY = 0; //no stretching on any of the axes
customBG.stretchZ = 0; //
customBG.rotationX = 0;
customBG.rotationY = 0;
customBG.rotationZ = 256; //rotated 90 degrees clockwise on the Z axis with angle ranging from 0 to 1023
customBG.mirrored = true; //mirrors background shape around center point

Violet CLM
May 4, 2023, 09:34 AM
This proposal is a lot more feasible now that we have property families like jjLAYER::warpHorizon (https://docs.jj2.plus/plus-angelscript.html#jjlayer::warpHorizon). It would be difficult to make a rotated warp horizon run at a decent speed--horizontal lines fundamentally run much faster than vertical ones--but some more properties could certainly be added if there is interest.