Author Topic: Pixel Shader 2.0 - Test  (Read 27790 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #20 on: September 15, 2007 »
I get 719 bytes for this (attached) using crinkler.  NO pixel shader yet though - maybe someone who can cut through the voodoo behind Microsoft's documentation can add it?

Right now it just draws a gouraud quad.

Jim
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #21 on: September 15, 2007 »
I'm no dx programmer but looking at your code maybe we could do the following:

1. Declare your array of points as not static
2. Get rid of colour and use a default FVF for the points (you dont need colour for the shader)
3. Leave lighting on...it wont matter when using shaders

???

Chris
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #22 on: September 16, 2007 »
Still wading through the useless documentation.
You are right about all your 3 ideas, they will probably be wins.  If you use a Vertex Shader it will be possible to eliminate the FVF stuff.  Dunno if it's even possible to mix and FVF based vertex shader with a Pixel Shader.
Did I mention the docs are crap?  There isn't even an example of using conditional code in vertex shaders, and presently I reckon it's not possible to branch at all in a dx pixel shader.

Jim
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Pixel Shader 2.0 - Test
« Reply #23 on: September 17, 2007 »
Nice work Jim

Anyway, as I told to Chris, I've "cleaned" my code, and here's the 1k Pixel Shader Framework ;D written in C.

It compress to 859 bytes (no IBO), added an example to load a texture from file, but of course you need to create your own tiny texture or color effect etc, the shader program example just draw the texture on the quad.

Well, 1k DX9 coded C is possible!


 :cheers:
« Last Edit: August 20, 2009 by rbz »
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #24 on: September 17, 2007 »
Thanks Rbraz! K+.  It should be possible to simplify this even more.  Chris won't want UVs.  Is it possible to pre-compile the shader to binary?  Sometimes that will be smaller than the shader text.

Jim
Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #25 on: September 17, 2007 »
Thanks Rbraz...karma to you and Jim for this.

It looks like it can get smaller yet. There are several interesting things here. It seems with work, the setup for dx shaders on a quad will be ... 700-750 bytes...or close to it. For opengl this is more like 800. But something else. On my ATi cards using glsl, many of the parameters that should be available in pixel shaders dont seem to be unless you have a vertex shader too. This means, unless I'm going daft, you need a dummy vertex shader, wasting more bytes.  In the end OGL seems to be around 170-180 bytes free therefore before you begin your intro whereas DX, at least on the surface seems more like 270-320. Its early days but :

1. dx shaders are better at 1k with a clear advantage, possibly nearly double the space!
2. At 4k, it makes much less difference.

Chris

 
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: Pixel Shader 2.0 - Test
« Reply #26 on: September 26, 2007 »
Excellent work Rbraz! Smooth and nice! 

[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Offline mind

  • Texture-San
  • DBF Aficionado
  • ******
  • Posts: 2324
  • Karma: 85
    • View Profile
    • boredom is a beatiful thing.
Re: Pixel Shader 2.0 - Test
« Reply #27 on: August 19, 2009 »
omg 200 days!! whatever.. nayways, you might wanna do a virus check on that archive.. might be the packer(wichever you use) but i figured i'd let you know, just in case..
http://www.synthesi.st/virus.jpg
« Last Edit: August 20, 2009 by mind »
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #28 on: August 19, 2009 »
Your virus scanner is probably warning about crinkler packed exes.  This happens, periodically, when the anti-virus people mess up.  We had a whole saga with AVG 18months or so ago...

Jim
« Last Edit: August 19, 2009 by Jim »
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Pixel Shader 2.0 - Test
« Reply #29 on: August 19, 2009 »
By the way, saw a neat trick the other day that could save a few more bytes.
No need to draw a quad, just draw a triangle that covers the whole screen.

Jim
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Pixel Shader 2.0 - Test
« Reply #30 on: August 20, 2009 »
omg 200 days!! whatever.. nayways, you might wanna do a virus check on that archive.. might be the packer...
200 days spreading virus!
Yes, it's a false alert, avast was complaining also, anyway I've update this archive.
Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: Pixel Shader 2.0 - Test
« Reply #31 on: August 20, 2009 »
I guess getting a few false positives is better than false negatives, imagine how fast the real virus's could spread then  :o