Jump to content


Photo

Shader Extension 1.4


  • Please log in to reply
82 replies to this topic

#61 HaRRiKiRi

HaRRiKiRi

    GMC Member

  • GMC Member
  • 1364 posts

Posted 05 May 2011 - 06:00 PM

Depends on the graphics card. Look at the specs and see if it supports pixel shaders and vertex shaders. Most PC's nowadays should be able to support 1.4 that this uses.
  • 0

#62 jobro

jobro

    GMC Member

  • New Member
  • 1247 posts
  • Version:GM8

Posted 14 May 2011 - 07:18 AM

Error in GameMaker 8.1 Pro when using the extension and just an empty room:

"Unexpected error occurred when running the game."

I dunno if I really should tell you guys this top secret... But anyway there is a tool that is designed to take the hard part out of writing shaders in assembly: ATI RenderMonkey. Give it a try, it really gives you the freedom to focus on designing the shader visually, and it generates the assembler code for you.

Edited by jobro, 14 May 2011 - 07:55 AM.

  • 0

#63 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 14 May 2011 - 03:00 PM

Error in GameMaker 8.1 Pro when using the extension and just an empty room:

"Unexpected error occurred when running the game."

I dunno if I really should tell you guys this top secret... But anyway there is a tool that is designed to take the hard part out of writing shaders in assembly: ATI RenderMonkey. Give it a try, it really gives you the freedom to focus on designing the shader visually, and it generates the assembler code for you.

This doesn't support GM 8.1 as far as I know.
  • 0

#64 Primoz128

Primoz128

    GMC Member

  • GMC Member
  • 278 posts
  • Version:GM:Studio

Posted 16 May 2011 - 09:15 PM

MagicNumber guess why first ! Because GMAPI doesn't work with GM 8.1 and also my gfx supports 4.0 so how can't you people have atleast 3.0 that my last gfx card 4 years old one had... bit confusing o.O.

Btw authour of this when GMAPI is updated he sed he wiill do it by now please update this with new GMAPI.
  • 0

#65 HaRRiKiRi

HaRRiKiRi

    GMC Member

  • GMC Member
  • 1364 posts

Posted 17 May 2011 - 05:47 PM

GM is using dx8, and that supports only shader model 1.4. That is why this extension also only supports this.
And your GFX card also supports 1.4, as they are all backwards compatible.
  • 0

#66 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 02 June 2011 - 07:23 PM

MagicNumber guess why first ! Because GMAPI doesn't work with GM 8.1

Oh, I didn't know.

For those that do not have Shader Model 1.4 support, your computer is old.

Edited by xot, 23 August 2012 - 05:29 PM.
profanity

  • 0

#67 Rexhunter99

Rexhunter99

    GMC Member

  • GMC Member
  • 922 posts

Posted 16 June 2011 - 06:22 AM

Question: Would this work on a integrated chip? I have a integrated graphics card on my computer so I wonder if this will work.

I know this is an old post but bear with me please.
This depends, you can tell whether your hardware/chip has shader support based on the DirectX or OpenGL API you have. If your computer supports DirectX10 and upwards or OpenGl 3.0 and upwards, then you have roughly Shader Model 2.0 support.

Back on topic. Rather sad how GMAPI doesn't work on GM8.1 I much prefer the improved speed we get in GM8.1 right now...
Also for those mooning over Shader Model 2.0 and up, we need to pester Mike Daily about changing a couple of the Direct3D Interface names ;) Converting D3D8 code to D3D9 code isn't hard, it just requires you to change all the 8's to 9's in the interface names and make an adjustment here or there.
  • 0

#68 jobro

jobro

    GMC Member

  • New Member
  • 1247 posts
  • Version:GM8

Posted 03 August 2011 - 04:31 PM

I haven't really had the time until now to dig in to the world of shaders, but this is no doubt an awesome extension that gives a whole lot of inspiration. Now I'm not an active game designer per say, but this gives me some friggin' fresh ideas for my album covers, so thanks a whole bunch for your extension!

As for RenderMonkey as I hinted you about above. It generates the code in C or C++. No programmer of range so I can hardly distinguish between them, but the point is: All shaders are created in real time. Say that you add a color shader, then that color shader is made available and editable, as well as previewed in real time. So check it out, for a tool being free it is pretty darn awesome to say the least.

I got a few questions:

1. Some people asked about the XYZ paramters. But couldn't Z be translated to depth? At least that is how it is done in 3D.

2. Can you take a shot of the current viewed area of the level, and do that on different depths?and save it to a surface, then render each individual surface differently? You got in the room editor the standard depth of 100000, then you could use a foreground at 90000, and a background at 110000 just as an example. It would be really nice if one could create the basic level  structure to be not affected by any shader, then apply a shader to the layers below. Is this possible

Edited by jobro, 03 August 2011 - 05:54 PM.

  • 0

#69 Indecom4000

Indecom4000

    GMC Member

  • GMC Member
  • 1148 posts

Posted 21 September 2011 - 02:39 PM

Sorry to bump this, how's progress on the extension coming along? I'm trying to learn assembly shaders, i know hlsl enough, in fact i'm trying to convert one of my ps_2_0 shaders to ps_1_4 asm lol. any hope for hlsl in this extensions future?
  • 0

#70 newbguy

newbguy

    GMC Member

  • New Member
  • 128 posts

Posted 19 October 2011 - 12:39 PM

another bump..but i've run into 2 snags.

firstly, i cant seem to change the texture wrap mode from anything except clamp. (I specifically set it to mirror, but its just clamping)

secondly, when i add a background image to my game my shaders behave weird.. you see, the really strange part is that the background doesn't even need to be used. if there is a background sitting in my backgrounds folder, my shaders still screw up. (the shader i am using is pretty much a copy of your distort shader, except that it takes a second texture and copies that textures alpha value into the resulting image..so nothing complicated).


edit:

just wanted to commend you on what an awesome job you did regardless.. came into the thread with problems so i just thought i'd point that out lol. the possibility this unlocks..awesome.

edit edit:

using gamemaker 8

Edited by newbguy, 19 October 2011 - 12:42 PM.

  • 0

#71 xot

xot

    media multimixer

  • Global Moderators
  • 4651 posts
  • Version:GM:Studio

Posted 27 April 2012 - 10:47 AM

This is fantastic, LSnK. I mean, I guess it must be. I haven't actually tried it yet. :laugh:

I found your shader example in the GMAPI topic and have implemented some pixel shaders with it. I was so excited to get started I didn't even look for this topic first. I think it would have saved me a ton of time. No worries, I got exactly the effects I was going for. It was touch and go, but the "mad" instruction saved my bacon (along with two math instructions).

It's a shame this doesn't work with newer versions of GM because I think people could use what I'm working on. It's a way to test GM games for color-blindness accessibility. I already made a proof-of-concept version using GM's built-in functionality, but it is very slow compared to a pixel shader.

Spoiler


I can't wait to try some more advanced effects with this. I've been wanting to get started with shaders for the longest time. Your original project was just the boost I needed. A million thanks to you, LSnK. :wub:
  • 0

#72 GS-games

GS-games

    Creative

  • GMC Member
  • 323 posts
  • Version:GM:Studio

Posted 22 May 2012 - 10:46 AM

I am getting this message every time I start the shader demo. I have installed the GEX, and the DLL is in the game folder. What is causing this error? Posted Image
I have a modern pc running windows 7 x64. I'm using Game Maker 8 pro

Specifications:
Radeon HD 6990 graphic card and a 6 core phenom cpu 3,2ghz.
8gb ram.


EDIT: I didn't read that it doesn't work with new Game Maker versions...

Edited by GS-games, 22 May 2012 - 10:53 AM.

  • 0

#73 Greylore

Greylore

    GMC Member

  • GMC Member
  • 38 posts
  • Version:GM:Studio

Posted 19 July 2012 - 06:29 PM

Is there any way to do a frame merge shader with this? Where the shader takes the average red, green, and blue of the current frame and that before it?
  • 0

#74 Master Xilo

Master Xilo

    GMC Member

  • GMC Member
  • 379 posts
  • Version:GM8

Posted 20 July 2012 - 12:06 PM

Greylore: That should be easy to do if you render the frame to a surface.

There is a GMAPI that works with GM 8.1: http://gmc.yoyogames...howtopic=519138
Do you think you could update this to work with that?
  • 0

#75 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1019 posts
  • Version:GM8

Posted 01 August 2012 - 07:57 PM

Is this an old topic? I dont know...

Could I use this too:

Draw a huge texture on a polygon and check per pixel where on the polygon it is, and draw the appropriate pixel from a certain texture at a certain position on the texture there on the polygon? So say I had 500 different textures. Could I use this shader system to draw all/some of these textures on the bigger polygon at any position?

If it can, this is probably going to create the fastest voxel rendering engine the GMC has ever seen...

Any ideas?

Zesterer
  • 0

#76 SyncViews

SyncViews

    GMC Member

  • GMC Member
  • 392 posts

Posted 01 August 2012 - 09:51 PM

Well last version was dec 2010, and it does not support GM 8.1 or later, the OP last logged in Feb 2012. So if people want it for newer versions some work is going to be required.
  • GM 8.1.x would require my version of the GMAPI to provide access to the Direct3D8 stuff (which I don't personally know where/how GM keeps in memory, so would need a lot of research), doable if there is demand since I don't require it personally at this time.
  • GM For Mac would require a Mac developer. Since I don't own GM for mac or any apple computers I cant do this at all
  • The Windows and Mac Studio exporters should be possible. If iOS and Android extensions can be written in native code/java (which can then call native code) I suspect you can do a similar deal as the Window's version, but again I don't own the required hardware and licenses to look at the GM Studio options.

So really, it comes down to someone that has everything required putting the required work in, or those that are capable but don't have the needed resources getting those resources somehow.
  • 0

#77 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1019 posts
  • Version:GM8

Posted 02 August 2012 - 07:50 AM

Well... I have no idea how to start building a pixel shader... But I would be happy to try if someone could lead me in the right direction... O_o Any ideas for a place I could start off? I take it I would need a faster language to build the DLL in... Maybe C++, C, or C sharp? I assume it would need to interact with Direct3D? I am really unsure as to where to start, but I might like to try...

Alternatively, would a rendering engine such as GMogre, Ultimate3D or the like support shaders like the one I require? I hope so...

I need the shader to have the capability to draw multiple (up to several thousand) textures on one polygon, but at different positions. Its gonna be complex, but if it works, the advantages are huge.

I'd love it if someone could help me out with this a bit, it is one of the first times I have come across a programming problem I cannot solve with just maths and GM before.

Zesterer
  • 0

#78 SyncViews

SyncViews

    GMC Member

  • GMC Member
  • 392 posts

Posted 02 August 2012 - 09:44 AM

If you grab my GMAPI source and can see what I am doing to make things work, but its pretty low level stuff. GMOgre etc. have the same problem. I could perhaps fix this extension for GM 8.1, but like I said, to get the studio platforms someone with that hardware and software is required, and I don't intend to pay for it.

Several thousand textures I think is basically impossible on any hardware accelerated GPU in any practical way, since there is not hardware support to sample that many in a given pixel/fragment program. You could build it up using an off screen render target perhaps, but then you are basically like rendering the entire thing 100 times per frame. I also see no need given that a single polygon is a pretty small thing in modern graphics, and so in many cases is likely to have less pixels than your texture count there.
  • 0

#79 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1019 posts
  • Version:GM8

Posted 02 August 2012 - 11:01 AM

What I mean is:

I have a 256 textures stored in a sprite (as multiple subimages)

I wish to draw 2 polygons (a square) with a patchwork of these textures on it. Each space on the square (the square is 16x16 units), the texture it should be is defined in an array. The only other way I could think of is drawing to a surface/backgroundm and then drawing this as the texture. But I have several thousand of these, each one unique. Thats a massive memory consumption. Too much for what I need :S

Not drawing >1 texture at one position, just a patchwork of different textures on the same quad/double polygon.

Zesterer
  • 0

#80 SyncViews

SyncViews

    GMC Member

  • GMC Member
  • 392 posts

Posted 02 August 2012 - 12:30 PM

You could possibly use a mesh with relevant uv coords. A pixel shader could perhaps calculate the uv's without extra vertices if you really want, but theres stilll the issue I explained of getting a shader extension to be supported again on the new GM versions, and a software emulation solution, while certainly possible, would be far slower than just making a draw call per 16x16 square.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users