Pages

Showing posts with label OpenGL. Show all posts
Showing posts with label OpenGL. Show all posts

Wednesday, May 15, 2013

OpenGL 2.1 +.OBJ files

                                      <My land ahead>


I have been out of business for a long time, too long in fact, but I gathered all my strength and decided I still wont surrender , so I decided to take a few steps to continue with my project.

First thing I thought was I needed to improve my Opengl Skills, that involved:
  • Drooping my Opengl1.x skills ( forgetting all the immediate drawing stuff)
  • Start with at least Opengl 2.1 (vertex and fragment shaders, + working with VAOS)


I could have chosen Opengl 3.3 or even 4.3, but that would mean dropping support for a wide amount of persons including all the "vga integrated in the motherboard" + mac users, so Opengl 2.1 + shader model #120 was my target.

I started learning on "modern opengl tutorial sites" like:
  • http://www.opengl-tutorial.org/
  • http://ogldev.atspace.co.uk/index.html
  • http://arcsynthesis.org/gltut/
First dilemma I had  was which API could I use with Opengl, I could have used SDL, but that would mean switching to SDL2, then I had Glut, not for me!! finally I chose "GLFW": http://www.glfw.org/ which is basically a framework to use opengl + window management + keyboard + mouse input, everything simple and working on Linux /Windows /Mac OS/X isn't it nice?

So I went my way working on it until I had an idea about how to use basic functions, and made a simple class to load exported objects on "Wavefront .obj" format, the class is quite simple to use:

  • cobj myasset; //instance an object..
  • myasset.loadmodel("land.obj","map.tga"); //load the obj file + the texture
  • myasset.draw(MVP); //draws the object!
I think it's hard to make it easier to use ;) the result of my work:

                                   <Forgive me for the silly models!>

So I had an object loader, what now? I needed somewhere to place the models, that was my second dilemma: I have no artistic skill so how to make a map?...

-libnoise (http://libnoise.sourceforge.net/) came to rescue me.. again, I just recovered an old project I used to generate noise maps and made an exporter so I could write obj files with the noise map, that is basically an height map + a color map, after a few attempts I got it working, and I was able to load it into blender!!


 And, adding a model + a transparent sea texture I got the final result:

<back into the business again!>

I'm exhausted, but at the same time very happy, good things coming soon!

 
 






Thursday, November 15, 2012

New Tilesets

I'm back, again!

I have retaken my project after the MySql + OpenGL experiments

My first step after deciding to improve the graphics of my game was to update my horrible tileset, so I searched for GPL'ed tilesets,... I was about to surrender but finally I found a very nice place:  RL Tiles , a nice collection of GPL tilesets that gave me basically all what I needed:

Monsters / characters (From Dungeon Crawl):



Items (From Dungeon Crawl):



But at this point I needed some aid with the terrains + some magic effects, so I remembered a very fun, addictive rogue like made in Java: Tyrant - The Java Roguelike I asked the creator, Mike Anderson if I could include the game images and he accepted if I redistribute it under GPL license, Thanks Mike!!

Mixed terrain from Dungeon crawl / Tyrant:

Magic Effects (Courtesy from Tyrant - the Java Roguelike):




All tilesets are 1024*1024 size, with the transparency set to Red:255/Green:0/Blue:255 (Pink), each one is divided into 32* 32 tiles with a size of 32*32 pixels (1024 tiles / tileset, space to grow!), finally all them are free to redistribute / use under GPL license.

In the next post I will speak about map storage with MySql and loading to ram..

Bye

Monday, November 12, 2012

Banned from 4Shared

<Today I got a crazy e-mail from 4shared:>

Dear Sir/Madam,

We have received a notification that certain materials you posted on the 4Shared website as described below infringe upon someone else’s copyright:


http://www.4shared.com/zip/HeeXFWb7/rpg.htm


<I got really shocked... me infringing copyrights? what??? Then I went to my blog and I got into my download section : >




<So a tutorial I have made coding with Open Source tools is infringing copyrights? libSDL? maybe Code::Blocks?>

<The e-mail continues:>

Access to the material complained of has been temporarily disabled or such material has been removed. In addition, the public sharing function for your account has been disabled. For instructions on how to dispute the copyright infringement claim, please read the section titled Counter Notification Requirements below. For instructions on how to re-activate your sharing function, read the section titled Re-activation of the sharing function of your account at the end of this letter.

In accordance with 4shared’s Copyright Policy, to which you are bound by virtue of agreeing to our Terms of Use, your account will be terminated and your access to 4shared services permanently banned following three instances of copyright infringement. Unless you respond by counter notification and successfully dispute the copyright owner’s claim, this will be considered your FIRST instance of infringement under the three-strike policy.

<So I have been accused by someone I don't know from something I have not done, and unless I demonstrate It's not right I may get permanently banned... strike one!!>

Counter Notification Requirements
If you do not believe that such materials are infringing and wish to have access restored, please provide a counter notification containing the following information to 4Shared Designated Agent for Notice of Claims of Copyright Infringement (“Designated Agent”) as set forth below:
1) Identify the material that was removed or disabled, and the location where it appeared before it was removed or disabled;
2) Declare under penalty of perjury that you have a good faith belief that the material at issue was removed or disabled as a result of either mistake or misidentification of the material to be removed or disabled;
3) Provide your name, address, and telephone number;
4) Provide a statement that you consent to the jurisdiction of the federal district court for the judicial district in which your address is located, or if your address is outside of the United States, for any judicial district in which 4Shared may be found, and that you will accept service of process from the person who provided the notification or an agent of such person.
5) Provide your physical or electronic signature.

Such counter notification must be sent via e-mail to our Designated Agent at dmca_agent@4Shared.com. 


 <So if I want to avoid being banned I have to send my PERSONAL ADDRESS, PHONE and I HAVE TO SIGN??? is that a judgement? should I pay a lawyer???, the email continues...>

Alternatively, you may send the counter notification to our Designated Agent using the contact information below:

Name of Designated Agent: Ganka Hadjipetrova

Address of Designated Agent: 745 Distel Dr., Ste. 110, Los Altos, CA 94022
Facsimile Number of Designated Agent: (650) 433-5471
If we receive a proper counter notice, then we may replace or cease disabling access to the allegedly infringing materials in ten business days in accordance with the provisions of the DMCA, unless our Designated Agent first receives notice that an action has been filed by the complainant seeking a court order to restrain the account holder from engaging in infringing activity relating to the material on our system or network.




You should also note that if you make any material misrepresentation in your counter notification that the material or activity was removed or disabled by mistake or misidentification, you will be liable for all damages, including costs and attorneys’ fees, incurred by 4Shared or any copyright owner or copyright owner’s authorized licensee as the result of our relying upon such misrepresentation in replacing the removed material or ceasing to disable access to it.
In the event you provide us with counter notification compliant with all requirements described above and the rights owner does not pursue the infringement claim further, 4shared will remove this instance of copyright infringement from your record and will not consider the take-down notice for purposes of the three-strike repeat infringer termination policy. If we receive a compliant counter notification, we will also re-activate your account’s sharing capability. Note that regardless of whether or not you challenge the infringement claim via a counter notification, 4shared will keep the take-down notification for its records.


 <So resuming FIRST: Take down my content with no real facts that it's something illegal , THEN if you dare give all your personal data to someone you don't know you may get your content restored... It stinks!! >

Re-Activation of the Sharing Function of Your Account
Note that if you send us a counter notification fulfilling all requirements described above, your account’s sharing functionality will be re-activated.
In case you do not challenge the take-down notification, you may still be able to re-activate the sharing function of your account. To do that, you must remove all copyrighted content for which you do not hold author’s rights and do not otherwise have authorization to use. Once you have removed all unauthorized materials from your account, you must declare under penalty of perjury that your account does not contain infringing files here. Take note that you will still have access to your files if you do not verify your account is infringement free, but you will not be able to share them publicly.


 Thank you.
Sincerely,
4shared Support Team
support@4shared.com


 <At this moment I was thinking.... OK I'm pretty sure that is just an scammer, but when I got into my 4shared account and found my file has been removed I got really angry!!!!>

< Guess what? I wont reply, I wont stay in a place I can get blamed for anybody with no , I will let the account die and will never return here>

< +1 to Digital Millennium Copyright Act, they have stopped an indie developer from sharing his Open Source - projects at 4shared!! Must feel real pride..>

<Sweet Internet Freedom>








Thursday, October 4, 2012

libNoise, OpenGL and George R.R. Martin

Hello

       I've been quite busy in the last weeks, but still had time to investigate a pair of libs:

When I was thinking in how to make a procedural generated map I saw simple-map-generation from Amit Pattel, so I knew I had to use a noise function generator, that lead me to discovered libnoise: it is a simple library that allows to generate noise maps, apply colors , generate height maps, and many other things!!:

<2d noise map loaded (left), and a zoomed window (right) >

After playing a while with it I knew my maps would be generated by 2D noise functions , first I loaded the map with standard SDL, and made a map explorer, with the zoomed map..

Then I tought.. what if those colored quads were drawn by OpenGL???

I was kinda afraid and excited about the idea at the same time...

Excited about all the things I could do with OpenGL...

Afraid because OpenGL meant start from 0 again .... So I got all the courage I had and told me myself... "If you are into computers you will be learning all your life"

So I started to read the "OpenGL RedBook" and after like 250 pages and failing a few times I finally got my color-map to load on screen with Opengl!



Well, it was just a bunch of quads, but you could just Imagine it is a map...

After that I loaded the height map too and made the "z" from the map depend in the height, so I got the first improvements:



But I didn't wanted to make a minecraft-clone... so I decided to make the quads based in the corners, not just floating quads...






I failed in my first attempt, but had a very fun land strips...



But finally made it! I was starting to get very satisfied with the results, but I wanted to make it smooth so I divided the quads into triangles:


It looked much better, but after I applied normals to all vertexes I got the look I was looking for:






Got it, finally!! , so resuming:

<A Map>

+


<An height map>

=

<A 3D map!>

A final Note: had a few hard weeks at work so many days I just didn't had energy to code, I have been reading instead George R.R.Martin book "A song of Ice and fire", and got pretty hooked to it, in fact I read the 3rd book (+-900 pages) in a week...

I'm still were do I continue now, any suggestions?

See you