Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Other Side of the Monitor > Thread: The Programming Thread
Thread: The Programming Thread This thread is 3 pages long: 1 2 3 · «PREV / NEXT»
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted February 22, 2017 07:20 PM
Edited by LizardWarrior at 19:24, 22 Feb 2017.

Maurice said:

It's also a ton of fun to figure out how it works - and then manipulate it . In that way, I actually once managed to introduce a new variable assignment and use that new variable a bit further, within the existing code. Was something in the map generation routine within X-Com2: Terror from the Deep. Kinda cool that it actually worked too .


That's quite impressive, would like to hear details What I like about assembly is that you can inline it with C and C++, so you get best of the both worlds. I also got a .pdf that teaches about converting disassembled code to C++, but never got around to reading it.

Maurice said:

I remember having a lot of fun with Heroes 5's script editor too.


I hope it's less confusing than ERM (heroes 3 WOG script languages) Never liked the ERM syntax, I find it very messy at a glance, though I never dabbled too much with it.

frostysh said:
From what books is better to start self education by a motto "How machines works?", the field of interests is deep understanding of structure of computers and stuff. Of course, will be amazing if those stuff can bring some money in the future. Coz' I have no any money per month for now

Basically I am interested in the Physics, Cybernetics, Machine-stuff, Neurology, AI, etc.

Thanx for the answers.


Now, it depends on what you want to start with. I'd say to first start with basic computer circuits, learn about electricity, transistors, and logic gates. And since you're such a tor supporter, you could use the tor library, just watch out for the printing years as a lots of things are outdated there.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted February 22, 2017 07:47 PM
Edited by Maurice at 19:53, 22 Feb 2017.

LizardWarrior said:
That's quite impressive, would like to hear details


There's a bunch of threads I made over at the strategycore.co.uk site about a year and a half ago:

Maps of spawnpoints and the likes (mostly informational, though, no programming in this one)
Enemy Craft Loadout and Alien types
Deciphering Alien behaviour on the Global Map
Datatable of Zrbite within enemy craft
Effects of difficulty levels on stats

And the one you're most interested in, a careful plough through the subroutines that handle the dynamic combat map generation:
Procedurally generated maps: the subroutine unveiled

It's the topic that basically started everything. I was curious about how it worked but not satisfied with the answers I got, so eventually I started digging through it myself. It took me longer than expected, but I had fun doing it, so all in all it was good . Further down that thread is my hard labor . In particular, this post and the one that follows it in that thread hold my attempts and success at modifying the game code at assembly level to introduce and use another variable .

Quote:
I hope it's less confusing than ERM (heroes 3 WOG script languages)


It is, it's basically a language like C or C++, just slightly different syntax and some generally available functions that "do" things ingame if you call them.

Quote:
Never liked the ERM syntax, I find it very messy at a glance, though I never dabbled too much with it.


Same here.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
tyrael
tyrael

Tavern Dweller
I must act
posted February 22, 2017 08:58 PM
Edited by tyrael at 21:35, 22 Feb 2017.

frostysh said:
From what books is better to start self education by a motto "How machines works?", the field of interests is deep understanding of structure of computers and stuff.



I found these two books interesting and easy to read. The first book talks about how the components of a computer work (the processor, the memory hierarchy, caching, I/O, synchronization between multiple processors in a single system etc). The second books takes a detailed look at the many functions an operating system needs to fulfill. This one is very interesting, as there are many things one would take for granted that need to be implemented.

The books can be read in any order and neither requires much (if any) previous knowledge to enjoy, but I recommend starting with the first.

- Computer Organization and Design - David Patterson, John Hennessy.  

- Operating Systems Concepts - Abraham Silberschatz, Peter B. Galvin, Greg Gagne.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostysh
frostysh


Bad-mannered
Famous Hero
WHY?
posted February 23, 2017 05:34 AM
Edited by frostysh at 00:37, 24 Feb 2017.

Wow.. thanx again, I thought nobody will answer. But for now I feel little bit bad, so I will reade the stuff when I will woke up.. .

LizardWarrior -

Harharhar... I will accept that as compliment, but unfortunuately the only support from frostysh to such cool network as Tor - is a banner for promotion purposes. I have no skills nor money to make other kind of support.
Is the Tor Library a boring place where information about history of Tor development are gathered? Or did you have mentioned 3,14*bay? Can you post a link to this library?

Well yeah, I it would be nice to read some stuff about cool things such as transistors, but can you be more specific, from what I need to start?

tyrael -

Ice,
I have found the first book (from up to down), but still can't find second book, I have looked at 3,14*bay, and found nothing like that. I also have this book: "How Computers Works - by Ron White", and also I have trying to get trough the book by crazy russia language (I can read on russian for little bit better than in english, but my Russian-Grammar perhaps even worst than ma English-Grammar stuff ) stuff about mathematics for "technikums" (low grade colleges in SU), that I have obtain in the paper version. Well this book is actually for Physicists, anyway it will be helpful.
I have made a large pause in my "Science way" coz' I have some real life problem, but for now I have a lot of time.

I just hope I will be able to obtain some cash with it, because in the opposite case I will be in the bad trouble in the future
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
frostysh
frostysh


Bad-mannered
Famous Hero
WHY?
posted February 24, 2017 12:42 AM
Edited by frostysh at 00:45, 24 Feb 2017.

I have barely look at "Computer Organization and Design" - it's seems to be very nice, for an exception - I expected to see more about history of computers, anyway bloody hell 656 pages, it will be nice journey...
Thanx again.

P.S. Oops, I am sorry for double post.

____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted February 26, 2017 11:11 AM
Edited by LizardWarrior at 09:17, 10 Jan 2018.

Maurice said:

It's the topic that basically started everything. I was curious about how it worked but not satisfied with the answers I got, so eventually I started digging through it myself. It took me longer than expected, but I had fun doing it, so all in all it was good . Further down that thread is my hard labor . In particular, this post and the one that follows it in that thread hold my attempts and success at modifying the game code at assembly level to introduce and use another variable .


Damn, I gotta step up my assembly game . I'm currently trying to learn assembly for x64 architecture. Mostly the same as x86, just bigger registers What I like about assembly is that it's pretty easy to inline it with C and C++ to increase performance.

Speaking of assembly, I tried to make some benchmarks for squaring dwords, C++ vs inlined x86 assembly MASM.

I discovered that pow from cmath (math.h for c), kinda sucks But using a custom function turned out to be better. I passed the values via copying. For measuring time I used a high resolution clock, not the best choice for measuring CPU time, but I think it's close enough for a ballpark value.


_forceinline
int power(uint32_t num, uint32_t power)
{
 uint32_t result=1;

 if (power == 0) return result;
 else
   for (auto i = 1u; i <= power; result*=num, ++i);

 return result;
}

_forceinline
int power2(uint32_t num, uint32_t power)
{
    __asm
    {
       mov eax, num  
       mov ecx, power
       shl eax, cl    
    }
}


Result after squaring 1000 32-bit with each function.

C++ total time(pow):5.70905----C++ median time(pow):0.0570905
C++ total time     :2.40523----C++ median time:     0.0240523
Assembly total time:0.0341092----Assembly median time:0.000341092


I used this to loop through:

for (uint32_t register i = 0u; i < 1000; ++i)
{
     power(20, 2);
}


Assembly is amazingly fast

Now about graphics, I found this awesome tutorial on PBR for OpenGL, will definitely try to implement some PBR of my own I used physically based materials in Unreal 4, but never programmed them on my own. This should be fun.

Quote:

Is the Tor Library a boring place where information about history of Tor development are gathered? Or did you have mentioned 3,14*bay? Can you post a link to this library?



It's a collection of book pdfs on all sorts of subjects, not sure how legal they are though I'm not sure if the site is still up as onion sites move and go down like crazy, but I remember getting some books on programming, electronics and Anarchist's cookbook back in the day.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted February 26, 2017 02:12 PM

It would be interesting to see how they programmed the pow function and what that means in assembly. My guess? They are evaluating stuff before they make the computation. Your function will fail when power isn't an integer, for instance, while I suspect that the pow function can handle those values.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted February 26, 2017 02:16 PM
Edited by LizardWarrior at 10:50, 02 Mar 2017.

_Check_return_ double __cdecl pow(_In_ double _X, _In_ double _Y);

Yeah, that must be it, it's written in C, not C++ so multiple functions via overloading or specialized templates are out of the question.

edit: Bump let's not let this thread die


____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted March 03, 2017 01:08 AM
Edited by Maurice at 10:43, 03 Mar 2017.

In that light: I've recently done a playthrough of Diablo 2 and wanted to modify some items. Last time I did that was before the 1.09 patch (probably 1.07 or something), while currently the game is at patch level 1.14b. As it turns out, in 1.09 they introduced a checksum value to cover the contents of the character savegame file. Took me a bit of crunching along with tidbits of information to get it figured out. Most irritating aspect is that the file is saved in one Endian form, but the calculations take the other one (Little vs. Big Endian).

At least I got it figured out now and can compute the checksum ... now to find out how to manipulate the item data . Everything is stored in hex format in the file. There's a lot of information available, but at the same time, since Blizzard has changed the format here and there, some information is downright contradictory or wrong.

Edit:

To be more precise, the assembly code was this:


:6FF52410 56           push esi
:6FF52411 8B74240C     mov esi, dword ptr [esp+0C]
:6FF52415 33C0         xor eax, eax
:6FF52417 33C9         xor ecx, ecx
:6FF52419 85F6         test esi, esi
:6FF5241B 7E1E         jle 6FF5243B
:6FF5241D 53           push ebx
:6FF5241E 57           push edi
:6FF5241F 8B7C2410     mov edi, dword ptr [esp+10]

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:6FF52437(C)
|
:6FF52423 33D2         xor edx, edx
:6FF52425 33DB         xor ebx, ebx
:6FF52427 8A1439       mov dl, byte ptr [ecx+edi]
:6FF5242A 85C0         test eax, eax
:6FF5242C 0F9CC3       setl bl
:6FF5242F 03D3         add edx, ebx
:6FF52431 41           inc ecx
:6FF52432 3BCE         cmp ecx, esi
:6FF52434 8D0442       lea eax, dword ptr [edx+2*eax]
:6FF52437 7CEA         jl 6FF52423
:6FF52439 5F           pop edi
:6FF5243A 5B           pop ebx

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:6FF5241B(C)
|
:6FF5243B 5E           pop esi
:6FF5243C C20800       ret 0008


The above was translated by a few people as pretty much being as a piece of pseudo code as follows:

For i = 1 to EOF do
CRC Value = CRC Value << 1 + Data(i)
Next

where the << 1 means a bit shift of 1 bit to the left (essentially this means the CRC Value is multiplied by 2) and the Data(i) is the byte from position i within the data file being added to the value.

This, however, doesn't work. The CRC Value is a 32-bit value and the sharp observer will notice that once you've made 32 bit shifts, the above means that the data element that was added 32 bit shifts earlier, is completely pushed through the CRC Value variable and essentially lost. Basically, the above pseudo code would only ever use the last 32 bits of the file to find the CRC Value, which kinda defeats the purpose of having a CRC Value in the first place.

Walking through the assembly code I listed above, this is basically what the code does:

Section 1:
push esi
-> pushes the register esi to the stack

mov esi, dword ptr [esp+0C]
-> moves the pointer to the location of the CRC value within the data stream, which is located as a dword (4 bytes) starting at the 13th byte (OC, keeping in mind that the first byte in the stream is addressed as 00).

xor eax, eax
-> performs an xor on all the bits of the eax register against itself, storing the result in that same register. Essentially, this sets all 32 bits in the eax register to 0.

xor ecx, ecx
-> same as above, except for the ecx register

test esi, esi
-> checks to see if the checksum has a value larger than 0 (if it's 0, there's no point in calculating if the file contents match the file checksum; apparently, the file is empty. Note that the register eax is returned to the calling routine as it isn't pushed to the stack before getting cleared above.

jle 6FF5243B
-> if the above test failed, it skips to the instructions at the given address.

push ebx
-> if there is something to calculate, the contents of register ebx is pushed to the stack, to preserve its current contents for prosperity.

push edi
-> likewise with the register edi.

mov edi, dword ptr [esp+10]
-> the register edi is getting filled with a pointer to the first byte after the CRC value, which starts from the 17th byte in the stream (0x10 is 16 in decimals, with the first byte in the stream counted as 00).

This is the basic setup of the loop that follows in the next section.

Section 2:
xor edx, edx
-> clears the edx register

xor ebx, ebx
-> clears the ebx register

mov dl, byte ptr [ecx+edi]
-> moves the next byte from the data stream into the register dl, which is part of the edx register.

test eax, eax
-> tests the contents of the register eax. The main reason to do this is to set certain state flags, which are evaluated in the next step. The two relevant ones for the next command are the SF (Sign Flag) and OF (Overflow Flag). The test instruction clears the OF (sets it to 0) and it sets the SF equal to the MSB (most significant bit) of the eax register, i.e. bit 31. This is 1 if the contents of register eax are equal to or exceed the value of 2147483648 (which is 2^32) and 0 otherwise. Keep in mind that as a 32-bit register, eax can contain (unsigned) values of up to 4294967295 (which is 2^33 - 1).

setl bl
-> sets the bl register equal to 0 if the SF and OF are equal, otherwise it's set to 1. The bl register is part of the ebx register.

add edx, ebx
-> the contents of the ebx register is added to the contents of the edx register.

inc ecx
-> the contents of register ecx are increased by 1. This register acts as a counter.

cmp ecx, esi
-> the code then compares the value of the register esi (which contains the total file length) with the value of the counter in the ecx register.

lea eax, dword ptr [edx+2*eax]
-> the 'lea' instruction (Load Effective Address) was originally intended as a quick and dirty address manipulation opcode, being faster than a simple 'mov' command, as the 'mov' also sets state flags, whereas lea doesn't. As such, when the value of the state flags aren't necessary for what follows (or should not be affected at all), the 'lea' command is better than the 'mov' command even for arithmetic expressions. It's used here in that form too: it fills the register eax with the contents of the edx register (which comes from the byte stream) and twice the contents of the eax register. Note that if this causes an overflow situation, those overflow bits are simply lost and no state flags are (un)set (most notably the OF); the contents of the eax register will hold on to the 32 least significant bits.

jl 6FF52423
-> if the 'cmp ecx, esi' instruction set a state flag, it jumps back to the start of the loop, which starts with the 'xor edx, edx' command at the start of section 2. Basically it only breaks out of the loop when the counter held in ecx exceeds the value held in esi, the file size.


Section 3:
pop edi
-> once the loop is finished, the original contents of register edi are restored by taking it off the stack and putting it back into the register.

pop ebx
-> likewise for the register ebx.

pop esi
-> and the register esi.

ret 0008
-> returns program control to the calling subroutine.

The crucial part that was missed in the pseudo code is also the part that basically preserves the bits that get pushed out of the window with the bit shifting:

test eax, eax
setl bl
add edx, ebx

When the register eax has the MSB set to 1 - which is the bit that gets pushed out of the window with the next bit shift - it's actually getting added back to the CRC value at the position of the LSB, the Least Significant Bit, of that CRC value. In other words, it wraps around.

Still, I had some troubles getting the CRC properly calculated, until I realised that this command:

mov edi, dword ptr [esp+10]

which is the final command of section 1, setting up the loop, was no longer getting used as this essentially means it skips the first 16 bits for all practical purposes of CRC calculations. These first 16 bits contain a standard header, the file size, game version under which it was saved and the CRC value itself. Obviously, some of it is relevant for the CRC as well, so in a later version they started calculating from the first byte instead of the 17th, with the caveat that the CRC value itself is considered 00 00 00 00 for its own calculations.

The calculated 4 byte CRC is stored in Little Endian, which is something that needs to be considered if you try to make sense out of it .
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted March 29, 2017 11:01 PM
Edited by LizardWarrior at 16:26, 30 Mar 2017.

Oh my, I let this thread die

Something I'm working on, fractals are fun. I want to do some form of anti-aliasing, I have decided to try to make (and learn how to do a) Gaussian blur.


Maurice said:
Most irritating aspect is that the file is saved in one Endian form, but the calculations take the other one (Little vs. Big Endian).


Oh, yeah, had problems with Endian changes while loading images, they are stored as little endian inside files, but you need them in big endian to use them. Nowadays I just use an external header to load my images, so I don't have to bother with those anymore.

As for diablo II modding, I haven't done much, I've used Hero Editor (it also has a hex editor inside), but never dabbled too much into it. As well as I'm not that good with Assembly, but I like having Visual Studio's disassembler during debugging as it gives you more insight about what's happening in there.  

Anyway, thank you for posting that, it may come useful when I start playing diablo II again. (maybe it will prove a good (dis)assembly exercise )

edit:
Tried to do a 2-pass gaussian blur, but the results didn't turn out to be better looking, I tried different sigmas and different kernels, but it still looked too washed away. Now I added linear interpolation, so that solves the smoothing problem on those Mandelbrot "lightnings". I also programmed some keyboard controls for zooming and changing "camera" positions, but rendering fractals in real time tends to be pretty CPU intensive (strangely as I did most of my work inside shaders), but I temporarily fixed that with some artificial lag so it doesn't have to render it that many times every second (I know this may not be the best solution but well).


____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostysh
frostysh


Bad-mannered
Famous Hero
WHY?
posted March 30, 2017 04:42 PM

Waw!
I liked Fractal-stuff, but of the Mathematicians said that this is not a fractal-images, this is only a simplified and crooked images of fractals. But I have not understood this Mathematician (I don't like Mathematicians, ).

P.S. I have so many books, and I don't know what to read. The Mathematics, Physics, or Machines, or Chemistry, or History, or Languages,  - I am disrupted and disordered. In addition the frigging Summer is coming, and the everyday hard-field work is coming along with it, but who knows...

So does anybody can advice to me, what I need to study first? My long term goals is the Artificial Intelligence, and Theoretical Physics (to be more preciously the connections of Gravity and Quantum World)

Thanx.
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted March 30, 2017 06:47 PM
Edited by LizardWarrior at 18:48, 30 Mar 2017.

Quote:
I liked Fractal-stuff, but of the Mathematicians said that this is not a fractal-images, this is only a simplified and crooked images of fractals. But I have not understood this Mathematician


Because "real" (theoretical) fractals are infinite, you can't draw something that is infinite in the real world.

frostysh said:
So does anybody can advice to me, what I need to study first? My long term goals is the Artificial Intelligence, and Theoretical Physics


frostysh said:
Mathematics, Physics, or Machines


You will definitely need those if you want to do AI, but above all, you must learn how to program. You may want to take a look at Prolog, not sure how widely used it is today, but it's a programming language made especially for programming AIs. Even so, you can create preceptors networks and genetic algorithms in pretty much any language.  
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostysh
frostysh


Bad-mannered
Famous Hero
WHY?
posted March 31, 2017 12:40 AM

And what about 3D world Fractals? What about 4D world fractals? Etc. Hmm?

Well, of the main problems of frostysh in term of studying something is that frostysh likes to blur himself over a wide area... for an example, I need to study programming stuff (Prolog noted! I think I will try it), but before I need to study how Machines works - an Electronic in particular, and to realize how Machines works I need to study Physics - Solid Body, Semiconductors, etc, and to study Physics I need to study Mathematics, in addition I need to study Neuroscience (I liked Cyber stuff ^^) so:

Mathematics (enough to understand anything in Physics that I want, I mean something including to Lie Algebra) ---> Physics (Quantum, Gravity, Solid Body) ---> Neuroscience (mostly Intellect, Mind, etc) ---> Electronics (only the stuff that touching AI) ---> Programming

OR

Mathematics and Physics, simultaneously (and English obviously) ---> Electronics and Neuroscience, simultaneously ---> and then Programming


OR

Mathematics and Physics, simultaneously + Programming ---> Electronics and Neuroscience, simultaneously + English.

Well, actually if I will obtain some skills in those fields, I think I will find job in my country, well the painment will be not very good but I still don't want to run out of ma' country, the reasons for that:

1) Well, I am somekind of a patriot, that because I was involved in some "events" for some long time.. To be more preciously, I am not a patriot, I just wish to restore a justice, I mean the peoples of ma' country is deserved for better life (it is not a social justice, or somekind, I think justice is an universal thing, it is invariant and exist in the only one single form - justice).

2) As the most of rural folks, frostysh is hard-wired to his farmlands, and I cannot just leave two peoples that living with me alone, one of this peoples is 70+ years old (this is my mother, yeah despite of my mother is old, the age of frostysh is not corresponding to her age.. well it is a long story), and second is ma' grandmother which is 90+ years old. I just cannot leave them, coz' they cannot hold the farm alone, it is impossible for them.
So the job in the large city is not acceptable too.


P.S. Recently finished reading of the Novel "WE", by mr Zamyatin, and started to read popular-level book - Peat D. From Certainty to Uncertainty.. The Story of Science and Ideas in the Twentieth Century (2002)(247s), from the first few pages it is looks ok.

P.S.S. I have asked same question on the another forums through the Holy Internet, well, for a short time I even have a desire to become a Cool Hacker, to obtain some cash (of course my life principles and ma' way is restricting frostysh for harming any poor weak and innocent peoples, so I wanted to become somekind of a Robin Hood )
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted April 01, 2017 09:08 AM
Edited by LizardWarrior at 09:36, 01 Apr 2017.

a) it's off-topic, this thread is about programming
b) every time you post such thing, you post an essay, it clutters the thread and derails the topic

Would appreciate if you could trim down to 2-3 phrases your last posts or delete them.

So, the mandelbrot saga continues, still haven't found a good way to anti-alias those. My gaussian blur, blurs them too much, even though I only use sigma 0.3 and a gaussian kernel of 5 values.



This is my gaussian algorithm so far (in GLSL). Will try supersampling next.


vec3 gaussian_blur(vec3 color)
{
float gaussian_kernel[] = {0.0f,0.04779,0.904419,0.04779,0.0f};

float normalizing_factor =0.0f;

int mSize = 5;
int kSize = int((mSize-1)/2);

for(int iter=0; iter<mSize;normalizing_factor+=gaussian_kernel[iter],++iter);

for(int i=-kSize; i<=kSize;++i)
for(int j=-kSize; j<=kSize;++j)
  color+=gaussian_kernel[kSize+j]*gaussian_kernel[kSize+i]*color;

return color;
}


and this is what I use for linear interpolation

if(int(iter) < 0x100)
{
           float log_zn = float(log( _sqr(complex.x) + _sqr(complex.y)));
           float nu = float(log( log_zn / log(2) ) / 2.0);
           iter+=(1-nu);
};

vec3 color2 = vec3(0.0f);
color2.b= float(iter+1.0f)/4.0;
color2.g= sin((float(iter+1.0f)/25.5));

float r =  0.0f, g = 0.0f, b  = 0.0f;

color = mix(color, color2, iter - float(int(iter)));


____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted April 03, 2017 03:22 PM

Here's some simple java emailing program I'm working on, more of an exercise. I'm not very satisfied with the design, so that's most likely to change.

____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted April 07, 2017 03:01 PM
Edited by LizardWarrior at 19:07, 12 Apr 2017.

C'mon guys, give this thread some love

Now I'm using WINAPI for the GUI, I also added normal mapping, dynamic light controls, various object controls and now it can open 3d files via a classic open dialog. Just the damn icon doesn't want to load for some reason (the big icon aka the taskbar one loads fine, but the small one aka window one doesn't)




edit: bump

Currently trying to write some autodesk plug-ins
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Corribus
Corribus

Hero of Order
The Abyss Staring Back at You
posted April 30, 2017 10:28 PM

Thread moved from VW. I also cleaned it up a bit. Now it must conform to OSM standards.
____________
I'm sick of following my dreams. I'm just going to ask them where they're goin', and hook up with them later. -Mitch Hedberg

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted May 02, 2017 10:25 PM
Edited by LizardWarrior at 22:39, 02 May 2017.

Thanks Corribus But OSM isn't that different from VW

Meanwhile I'm having fun with ObjectArx(autocad's C++ plug-in framework). Yay for more fractals

____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
EnergyZ
EnergyZ


Legendary Hero
President of MM Wiki
posted May 03, 2017 11:06 PM

Do you think 1 hour is enough to make an graphical interface with some code that displays an image? It's just some of my colleages have done a test like that.
____________
Come and visit the Might and Magic Wikia!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
LizardWarrior
LizardWarrior


Honorable
Legendary Hero
the reckoning is at hand
posted May 03, 2017 11:13 PM

That's not that hard. Of course it depends on what language and framework, as well the image. If you need to "code" that imagine, let's say a fractal, it may take more time, if you just need to load an image, then it's pretty simple provided you got a framework/library that can read the format. If you need to write a parser function for your given format, then depends.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 3 pages long: 1 2 3 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1123 seconds