dkdoom's Recent Forum Activity

  • i'm working on it :)

    (the fractal shader is out of reach for me, though, since it needs ps version 3.0...)

  • hi again,

    when putting the following pixelshader on a sprite:

    float4 color = tex2D( foreground, Tex.xy + 0.1 );
    return color;[/code:17zosu4h]the texture is not only displaced as expected, but even drawn outside of the sprite's bounds. it also produces strange artifacts when moving the sprite close to the layout's borders. this happens with and without any combination of #BORDERMODE and #CROSS-SAMPLING, with varying funniness.
    
    the following pixel shader, on the other hand:
    [code:17zosu4h]float4 color = float4( 0, 0, 0, 1 );
    if( Tex.x <= 0.1 ){ color = 1; }
    if( Tex.x >= 0.9 ){ color = 1; }
    return color;[/code:17zosu4h]produces white stripes on the sprite only when its bounds are moved near the borders of the layout.
    
    could you enlighten me with what's going on, aka what geometry & texture the shader is really working on? (it is confusing that the first is not a sprite-sized quad since it can [i]sometimes[/i] render beyond its bounds, and the second is not the sprites' texture since a texture coordinate of (0,0) refers to the top left corner of the layout...)
    
    thank you very much again!
  • thanks! i completely missed out on the wiki page

  • while some aspects of the shader implementation in construct (like the way parameters are specified, fore- and background-textures and the technique are named) are obvious from looking at the examples, i'm having trouble porting other shaders. mostly because of the omitted vertexshader, which breaks some of them in unexpected ways (related to world, view & projection spaces) that probably originate in wrong texture coordinates.

    in which way are texture coordinates handled in construct? which spaces are handed to the pixelshader? and are there any hooks in the implementation concerning sampler states / address modes?

    thanks for your time...

  • not out of the box. but thanks to directx, construct also uses .fx files written in HLSL, so the changes are marginal. most of them are due to the different ways the both programs interface with the shader.

    very short semi-informed manual: when looking at the Additive.fx in construct's effect folder, you can see that the most important (and in this case only) thing is to define a technique called ConstructEffect, which construct calls. when looking into any 'foreign' .fx, you will also find these definition (mostly at the bottom). these techniques tell which functions should be used for vertex- and pixelshading. if you just boldly go and rename them to ConstructEffect, construct can uses the shader. make sure to have VertexShader refer to null, though (else it didn't work for my first try).

    i'm just trying this out, so take it with a grain of salt, but i guess by looking at the other .fx in the construct folder, it should become obvious in which way one has to define variables for them to appear in construct.

  • admittedly, when thinking about it, i don't know of any easy ways to e.g. remove specific tags out of a private variable... since i'm a newbie, you should probably look into more advanced techniques than my 'first ideas' ;)

  • careful now!

    small steps => small victories & small failures => continuous motivation!

    that said: my first idea would be to implement tags using a private variable and the Find() system expression to check wether a tag is present. when i tried that, it turned out okay, but it appears there are some bugs (the condition that checks for a tag evaluates inverse truth).

    (edit: it only evaluates inverse when picking families, so the bug is pretty specific there...)

  • although you already said that you're really looking for procedural generation (which you could do with events), here's a link to the vvvv shader page which contains a fractal shader (ClassicFractals.fx).

  • edit nvr mind

    don't say that! other people might like to know, too :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hm, this is the second time i find something important hidden behind a right-click at the right spot ...

    i don't know if this is random or intentional reoccurance, but it would certainly be great to document it somewhere :)

  • off topic, but how did you manage to put an expression into the 'set color filter' action? it defaults to a colorpicker ...

  • sooo... will we get outline-free comments? :P

dkdoom's avatar

dkdoom

Member since 6 Dec, 2008

None one is following dkdoom yet!

Trophy Case

  • 15-Year Club

Progress

15/44
How to earn trophies