Ok, so today I lost some hours of my life coding NormalMap with AGS Script.
In case you want it, Download the Demo here! (https://drive.google.com/file/d/1UnyiU_3D74vfEok5TkspjDVJV1nz79Kv/view?usp=sharing).
I don't think it looks good, I decided to ditch this idea, but maybe someone wants to try and test this.
I based my code on the code here (https://29a.ch/2010/3/24/normal-mapping-with-javascript-and-canvas-tag).
If someone does make it better, faster, please share your enhancemets here!
(https://i.imgur.com/JoW8fec.gif)
This is awesome.
"WARNING - There has been no post in this topic for at least 120 days"
Dualnames: "Son, I know what I'm about, leave me be"
https://twitter.com/Dualnames/status/1103864496626446336
I read so many posts from the dude with anime Rachel pic when I was learning AGS that I am really happy to have done something that turned out useful for you :)
I'm sorry u had to go through my posts.
A small test, http://primordia-game.com/Files0/Strangelando/lighttestv2.rar
I imagine that the normals map has to be exported then imported into AGS at some post? If that's correct, then under which format is it done?
@Monsieur OUXX, you are not wrong, but Dualnames is a crazy brilliant person who also added dynamic normal maps creation if you don't provide one.
This particular test has normal maps generated by the plugin
Quote from: Dualnames on Tue 12/03/2019 16:43:27
This particular test has normal maps generated by the plugin
So what's the strategy? Do you need to pass a greyscale sprite and the pixel's grey value provides the orientation of the pixel?
I think it accepts a rgba bitmap as a sprite where color to displacement maps RGB to XYZ
X: -1 to +1 : Red: 0 to 255
Y: -1 to +1 : Green: 0 to 255
Z: 0 to -1 : Blue: 128 to 255
Nope, the plugin grayscales it for you, u define the 'intensity' of that. You literally just do
DrawNormalMap(int sprite, int id) where sprite is the sprite you're importing and id is the id of the normal map, and it generates a normal map
So if you use a dynamic sprite you can use that to feed to the next function which Creates a normal map 'pattern' out of a normal map and a sprite.
Quote from: Dualnames on Tue 12/03/2019 18:46:06
Nope, the plugin grayscales it for you, u define the 'intensity' of that. You literally just do
DrawNormalMap(int sprite, int id) where sprite is the sprite you're importing and id is the id of the normal map, and it generates a normal map
So if you use a dynamic sprite you can use that to feed to the next function which Creates a normal map 'pattern' out of a normal map and a sprite.
Perfect! All of you!
I've uploaded both the AGS project file and the source code of the plugin here, https://github.com/Dualnames1/AGSNormalMap I'm working on other stuff right now, so it's hard for me to progress with this currently, i'll come back to it, definitely.
Quote from: Dualnames on Wed 20/03/2019 11:44:09
I've uploaded both the AGS project file and the source code of the plugin here, https://github.com/Dualnames1/AGSNormalMap I'm working on other stuff right now, so it's hard for me to progress with this currently, i'll come back to it, definitely.
That is awfully generous of you. Thank a lot!
I don't mind <3
Quote from: eri0o on Sat 09/12/2017 22:38:28
Ok, so today I lost some hours of my life coding NormalMap with AGS Script.
In case you want it, Download the Demo here! (https://drive.google.com/file/d/1UnyiU_3D74vfEok5TkspjDVJV1nz79Kv/view?usp=sharing).
I don't think it looks good, I decided to ditch this idea, but maybe someone wants to try and test this.
I based my code on the code here (https://29a.ch/2010/3/24/normal-mapping-with-javascript-and-canvas-tag).
If someone does make it better, faster, please share your enhancemets here!
(https://i.imgur.com/JoW8fec.gif)
Great Scott!!! what kind of sorcery is this!!
Hey, I tried to workout the building of Dualnames Normalmap plugin here (https://github.com/ericoporto/AGSNormalMap/releases). Thing is when actually trying to use, well, it's working on Windows, but I am getting an error under linux:
Error: Plugin 'agsnormalmap' is an old incompatible version. Does anyone knows why I am getting this error? (I found it comes from agsplugin.cpp (https://github.com/adventuregamestudio/ags/blob/release-3.4.3/Engine/plugin/agsplugin.cpp#L958))
Spoiler
Adventure Game Studio v3.4 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2019 others
ACI version 3.4.3.1
Initializing allegro
Initializing game data
Located game data file: /home/erico/git/AGSNormalMap/AGSProject/Compiled/Linux/data/AGSProject.ags
Opened game data file: game28.dta
Game data version: 49
Compiled with: 3.4.3.1
Setting up game configuration
Logging scipt to "warnings.log"
Setting up window
Initializing TTF renderer
Initializing mouse: number of buttons reported is 3
Checking memory
Data directory: /home/erico/git/AGSNormalMap/AGSProject/Compiled/Linux/data
Initializing keyboard
Install timer
Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory
Warning: cannot enable MIDI audio.
Problem: No compatible drivers found in the system..
You may supress this message by disabling MIDI sound in the game setup.Installed digital driver ID: 'ALSA' (0x414c5341), MIDI driver ID: 'None' (0x0)
Install exit handler
Initialize path finder library
Game GUI version: 118
Requested script API: v3.4.1 (5), compat level: v3.3.4 (2)
Plugin 'agsnormalmap' loading succeeded, resolving imports...
An internal error has occurred. Please note down the following information.
If the problem persists, post the details on the AGS Technical Forum.
(ACI version 3.4.3.1)
Error: Plugin 'agsnormalmap' is an old incompatible version.
***** ENGINE HAS SHUTDOWN
Quote from: eri0o on Fri 07/06/2019 00:57:07
Hey, I tried to workout the building of Dualnames Normalmap plugin here (https://github.com/ericoporto/AGSNormalMap/releases). Thing is when actually trying to use, well, it's working on Windows, but I am getting an error under linux:
Error: Plugin 'agsnormalmap' is an old incompatible version.
This error simply means that there's no AGS_PluginV2 symbol defined in plugin. Since it works on one system but not another I would make first guess that it does not compile or link correctly.
See
https://github.com/ericoporto/AGSNormalMap/blob/master/NormalMap/plugin/agsplugin.h#L449
PS. Actually, the error message is silly, it has nothing to do with "plugin version", it should rather say that an expected symbol is not found or that plugin is not complete.
yeah, thanks Crimson! I did stupid things! just fixed :D (https://github.com/ericoporto/AGSNormalMap/releases/tag/1.0.0)
Working on Linux!
(https://i.imgur.com/JnZL5Kq.png)
It's not quite right under OpenGL, but now is time to sleep :]