Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 ... 23

Author Topic: [PRINT_MODE:SHADER]  (Read 89647 times)

dennislp3

  • Bay Watcher
    • View Profile
Re: [PRINT_MODE:SHADER]
« Reply #105 on: February 14, 2012, 07:03:49 pm »

Posting to watch this! yes...look how productive I am by adding my constructive self to your list of stalkers!
Logged

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: [PRINT_MODE:SHADER]
« Reply #106 on: February 15, 2012, 12:25:33 pm »

Hello!

You asked me something on IRC while I was asleep and I couldn't reply. So, here:
Quote
[00:00:00] - {Day changed to Wed Feb 15 00:00:00 2012}
[00:30:27] <lxnt> peterix, _Q: I'm working on separating angavrilov's generator and supporting code from dfhack into a standalone lib so as to not be forced to link whole dfhack into libgraphics.so.
[00:30:50] <lxnt> peterix, _Q: any objections?
[00:31:13] <lxnt> peterix, _Q: (to merging this ofc)
Sounds like a good idea! Thing is, I'd like it to still work with the stock precompiled libgraphices just like it works now...

From the technical point of view, you still need a good chunk of DFHack, as it needs to init some stuff - it needs to determine the version of DF and load up the appropriate version info (really an extension of DF's symbol table) from an xml file. All you'd be cutting out is the console and the plugin API, which are rather minimal anyway. The modules are helpful too, providing some abstractions on top of DF's structures...

On the other hand, the hackish way DFHack interfaces with DF's execution could be much improved. Right now, DFHack hooks some SDL calls, which isn't exactly ideal. It would be nice to be able to paint into DF's window and sync with the graphics thread for example. Or have libgraphics directly call Core methods.

Anyway, more details could certainly help.

lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #107 on: February 15, 2012, 02:10:52 pm »


Sounds like a good idea! Thing is, I'd like it to still work with the stock precompiled libgraphices just like it works now...
It is most certainly my intention to not disrupt dfhack operation in any way.

From the technical point of view, you still need a good chunk of DFHack, as it needs to init some stuff - it needs to determine the version of DF and load up the appropriate version info (really an extension of DF's symbol table) from an xml file. All you'd be cutting out is the console and the plugin API, which are rather minimal anyway. The modules are helpful too, providing some abstractions on top of DF's structures...

I abstracted out whatever df-structures need from dfhack into
Code: [Select]
class essentials {
public:
    virtual std::string readClassName(void *) = 0;
    virtual void lock() = 0;
    virtual void unlock() = 0;
    virtual std::map<std::string, void *>& getVtable() = 0;
    virtual void *getGlobal(const char *name) = 0;
};

I mostly split dfhack and df-structures already, moving them into depends. Now I'm cleaning up resulting bugs.

Since the code that prepares data for a frame to be rendered needs to run as fast as practical, wrappers are out of question.

Since df-structures are in fact inseparable from DF version, I expect Memory.xml being removed from dfhack runtime, globals' and vtable addresses being moved into df-structures. Only code checking that the DF version is correct/compatible with the df-structures build is in fact needed; addresses can be compiled in since it is most likely that each DF point release would require verification of entire df-structures xml data, baking a corresponding release  compared to that is trivial.

On the other hand, the hackish way DFHack interfaces with DF's execution could be much improved. Right now, DFHack hooks some SDL calls, which isn't exactly ideal. It would be nice to be able to paint into DF's window and sync with the graphics thread for example. Or have libgraphics directly call Core methods.

Anyway, more details could certainly help.

Well, I most certainly can define some weak no-op symbols (in my libgraphics.so) to be called wherever you like, so that when dfhack is preloaded, it will be able to substitute its own. I don't know much if anything about windows in this regard above suspicion that making a libgraphics.dll would be hell of a headache.




lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #108 on: February 22, 2012, 08:28:17 pm »

Code: [Select]

# lxnt has created  fgtestbed , a lump of  python code
# all masterwork is of  dubious  quiality.
# it is studded with  bugs
# it is encrusted with  bugs
# it menaces with spikes of  bugs
# it smells of  bugs
# a picture of  giant bug  is engraved on its side
# ...
# lxnt cancels Debug: interrupted by  bug


https://github.com/lxnt/fgtestbed
« Last Edit: February 22, 2012, 08:35:34 pm by lxnt »
Logged

lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #109 on: February 24, 2012, 08:46:50 pm »

So it works at last. Had to redo it in glsl 1.30 though.

This ulopc currently demonstrates stunning animated map display using curses_square_16x16.png . Marvelous. I also found my proposed raws format unfit for duty, and map dumping code obviously does it wrong.

Unleash your talents on animating stone walls right now!

https://github.com/lxnt/fgtestbed/downloads

needs python, pygame, pyopengl and OpenGL 3.0 / GLSL 1.30

xordae

  • Bay Watcher
    • View Profile
Re: [PRINT_MODE:SHADER]
« Reply #110 on: February 24, 2012, 10:03:05 pm »

Posting to watch.
Logged

guale

  • Bay Watcher
    • View Profile
Re: [PRINT_MODE:SHADER]
« Reply #111 on: February 25, 2012, 01:38:47 am »

I have no idea how I never saw this before, given how much of a serial lurker I am. I just read through the whole thread (skimming most of the actual code since it goes way over my head) and I have to say you are quite the badass, lxnt. I'm hoping this will give me the needed motivation to get a proper install of Ubuntu going on my new machine sometime this weekend and if I do I'll most certainly give it a go.
Logged

Mike Mayday

  • Bay Watcher
  • gfx whr
    • View Profile
    • Goblinart
Re: [PRINT_MODE:SHADER]
« Reply #112 on: February 25, 2012, 05:27:50 am »

Gonna set up some portable Ubuntu and try this today.
Don't get your hopes up, I'm terrible at setting up a proper software environment.
Logged
<3

lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #113 on: February 25, 2012, 05:53:03 am »

Gonna set up some portable Ubuntu and try this today.
Don't get your hopes up, I'm terrible at setting up a proper software environment.

You don't need ubuntu to try this yet - it's pure python.
Install this: http://www.python.org/download/releases/2.7.2/
then this: http://pygame.org/download.shtml
then this: http://pyopengl.sourceforge.net/documentation/installation.html

never tried this, but should be on par or easier than setting up Ubuntu.

Krakarn

  • Bay Watcher
    • View Profile
Re: [PRINT_MODE:SHADER]
« Reply #114 on: February 25, 2012, 07:18:15 am »

Actually I already tried it on windows, additional package required was numpy. Also, the "from o import cx" line was not working. Also, there was a runtime error concerning casting int as uint in a gl function.
Logged

lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #115 on: February 25, 2012, 11:16:53 am »

aw,
o.cx isn't used by default, you can delete or comment out the
Code: [Select]
from o import cx as glnames
line in fgtestbed.py

Quote
runtime error concerning casting int as uint in a gl function.

this one is interesting though. Can you post the error?

lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #116 on: February 25, 2012, 02:19:13 pm »

new and improved version (re-download from the github).

works with full map dumps, only limit on zoom-out is minimum 2x2 tile size as drawn.

two map dumps to look at:
5x5 embark
16x16 embark

These are full map dumps, smaller has 180 z-levels, larger - 118. Decompress files aside the fgtestbed.py, run it like:
Code: [Select]
./fgtestbed.py bigdump

When you see a black screen - don't panic, zoom out, scroll around, change levels. Supplied raws just don't define enough tiles, so most are drawn black.

The big dump even right-mouse-button scrolls acceptably on my machine. Most probably because of SSD disk. Expect lag and disk thrashing if you don't have one.

Krakarn

  • Bay Watcher
    • View Profile
Re: [PRINT_MODE:SHADER]
« Reply #117 on: February 25, 2012, 02:44:05 pm »

fgtestbed.py, line 463

RuntimeError: Link failure (0): Vertex info
---------
0(44) : warning C7533: global variable gl_ModelViewProjectionMatrix is deprecated after version 120
0(82) : error C7011: implicit cast from "int" to "uint"
0(82) : error C7011: implicit cast from "int" to "uint"

Fragmet info
------------
0(48) : warning C7533: global variable gl_FragColor is deprecated after version 120



--
Also, those dumps you posted gives the same error for me.
« Last Edit: February 25, 2012, 02:55:01 pm by Krakarn »
Logged

lxnt

  • Bay Watcher
    • View Profile
    • pm:full_graphics
Re: [PRINT_MODE:SHADER]
« Reply #118 on: February 25, 2012, 03:03:15 pm »


--
Also, those dumps you posted gives the same error for me.

Please replace the line
Code: [Select]
blend = vec4(insn.z >> 8, insn.z & 0xffu, insn.w >> 8, insn.z & 0xffu) / 256.0;

with

Code: [Select]
   
blend = vec4(insn.z >> 8u, insn.z & 0xffu, insn.w >> 8u, insn.w & 0xffu) / 256.0;

in the file three.vs, try again and let me know.

« Last Edit: February 25, 2012, 03:07:22 pm by lxnt »
Logged

Krakarn

  • Bay Watcher
    • View Profile
Re: [PRINT_MODE:SHADER]
« Reply #119 on: February 25, 2012, 07:03:41 pm »

Ok, the program works now but it looks like a mess of pink letters. Am I supposed to look at something here?
Logged
Pages: 1 ... 6 7 [8] 9 10 ... 23