Product Chat / Community input required

Author
Message
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 22nd Feb 2014 00:48 Edited at: 22nd Feb 2014 01:29
Since Lee is swamped out with performance fixes and TGC are a small company,I don't want to be making this a request for yet more features, more seen as an opportunity for the community to help out with this development.



Every little helps and even though we don't know the engine or have access to the source we could still help in our own way.



To get to the nub of this..I am feeling the lack of waterfalls, explosions and all that lovely eye candy that makes your game pop. This of course will come but there is no harm in us as users experimenting a little outside the box in looking at way's of implementing these.



I am talking shaders here and though I am no coder it doesn't take long to get the idea of how these work when you dig into the code.Bond1 wrote the shader system for Reloaded and he really knows his stuff. The shaders in Reloaded are set up to be tweaked and many functions are already in place to be switched on/un-commented and used. The basic_fx shaders are designed for future use, simply tweaked and renamed for their own requirements.



I have been looking at modeling some waterfalls for Reloaded which would be dropped right into the editor as a single prop. The mesh base with steep rocks etc are no problem and the dropping water cascade is simply done using a scrolling texture shader to move the water texture across the surface (bond went a little further with the metro pack and scrolled the normal map). So I set about trying to add this simpler shader into the mix.



First things first, I do own DarkShader and although there is a patch to make it work with Reloaded shaders it simply doesn't work for me. The model always appears black and even if I fill all the texture slots it still returns the 'not enough textures error' so I have no visual on what I am doing. All the same I can still compile and see where any errors in the shader code might be



On first viewing you will find this in the The Main Vertex Shader:



//modify uv co-ordinates using the time value OUT.uv = IN.uv + float2(directionX,directionY)*time



Looks like the place to start, so I un commented this and of course on compile it will return an error, it's not going to be this simple.



In the Data Structs you have slightly different naming:



struct appdata

{

float2 UV : TEXCOORD0;



struct vertexOutput

{

float2 TexCoord : TEXCOORD0;



Seems caps are important too so it changed to this:



OUT.TexCoord = IN.UV + float2(directionX,directionY)*time;



We now need a float to send values to this function so looking at the default scroller in DarkShader we have a couple of values for direction, with the added bonus of a slider control



float directionX

<

string UIWidget = "slider";

float UIMax = 3.0;

float UIMin = -3.0;

float UIStep = 0.01;

> = 1.0f;



float directionY

<

string UIWidget = "slider";

float UIMax = 3.0;

float UIMin = -3.0;

float UIStep = 0.01;

> = 1.0f;



Wasn't sure where to add this so put it in 'Standard Constants'.



The shader now compiles without error, all the same in my research both in Darkshader and online I have found this line accompanies the subscript:



OUT.Position = mul( IN.Position, WorldViewProjection );

OUT.TexCoord = IN.UV + float2(directionX,directionY)*time;





So I included it even though I haven't the slightest clue what I am doing



The shader still compiled without error, but I don't have any idea if the texture is scrolling or not as Darkshader wont give me a visual in the preview window, I can only try it in Reloaded itself.....saved out as scroller_basic.fx



Of course it doesn't work and I get this error at start up:







So it looks like Reloaded won't recognize these values just yet or it's that I simply messed up



I don't want to annoy Lee with e-mails about this at this stage but know he visits these forums more regularly now so maybe can give some advice when he has a spare moment. I would mostly like input from the community themselves who may have an idea why I can't get Darkshader working for Reloaded shaders or perhaps an alternative way of viewing these. Particularly input from the coders around here and those who like to tweak and mess around with shader code.



If I can get this working I would move onto explosions,falling debris, caustics etc and create accompanying media, using Atlas walk which is a huge improvement on the old decals. I know a demo of explosions was shown before but not heard much of this since so it may be time wasting but still these shaders can be utilised in many,many ways and a benefit to us all.



Sorry for the long blown out post, it would have been simpler just to post the shader, but not sure it would get me in trouble to release that

Lee-"...and before you know it you're a shader coder!"



rolfy-"Coding...To me this is the Dark Arts..don't blame me when something Evil comes to claim y'all if I dabble in it"
Scene Commander
Support Manager
16
Years of Service
User Offline
Joined: 3rd May 2008
Location:
Posted: 22nd Feb 2014 09:07
I think every little helps. For information, the explosion code is completed, but I believe that performance and memory usage have become such important issues that it'll be a little while before it's ported into the main code.



And you're right about not publishing the shader, snippets are fine, the whole shader wouldn't be.



SC

Bringing you games since 1981!
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 22nd Feb 2014 09:30 Edited at: 22nd Feb 2014 09:47
Thanks for the heads up, still, I would love to get these shaders working, the ability to apply them to custom shaped meshes makes all the difference for some explosions and particularly debris animations with hardly any cost to performance if done correctly.



The problem is, as I say, no way to view if the shader is working or not and so no way to tell if I am wasting time tweaking them further if they don't load up in the editor. Also as you say I can't send the shader out to anyone to look at for me other than TGC themselves or even release with media unless TGC approved so maybe I will simply drop it for now. Thanks for making that clear before I did anything stupid.



Lee has offered to look at it but we really want him working on the things he should be so it can wait

Lee-"...and before you know it you're a shader coder!"



rolfy-"Coding...To me this is the Dark Arts..don't blame me when something Evil comes to claim y'all if I dabble in it"
BioDragonlord
10
Years of Service
User Offline
Joined: 17th Dec 2013
Location: Australia
Posted: 22nd Feb 2014 12:49
This my or my not help



either way its worth the read.

http://rbwhitaker.wikidot.com/hlsl-tutorials

Bring It On

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Feb 2014 19:58
A waterfall effect would be nice. Never dabbled in shaders myself, so can't really help. Also always found Dark Shader next to useless, down to me not knowing anything about it I imagine. Tried it in Reloaded, but nothing seemed to work, not that I tried more than a few tests.

I'm sure someone with shader knowledge will be able to help. It would be nice to see some Bioshock water effects all over the place

synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 24th Feb 2014 00:07 Edited at: 24th Feb 2014 00:08
What about the shader in "Metro flooded " in FPS Creator Classic ?

The water falling from the roof to the floor was effective...Cant that be adapted to a waterfall ?
PM
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 24th Feb 2014 00:23
I really don't no anything about shaders,I no in one game engine we used a animated texture aplied to a model of a waterfall and used a smoke particles at the bottom.looked cool when finished,as I said I am not rreally good at this sort of thing so I might not be on the right track .



Dave

AMD Phenom(tm)IIx6 1090t Processor 3.20 GHS

8.00 GB memory Windows 7 64 bit

Nvida Geforce GTX 580
PM
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 24th Feb 2014 01:05 Edited at: 24th Feb 2014 02:44
Thanks guy's, the link you gave me is probably where I was already at with shaders, I get the pipeline, but thanks for that.



Thing with these shaders is that they are so tightly tied to the engine I cant get them to work in anything else. Loading the entity_basic.fx into Shader fx or FX composer and compiling, will return a bunch of highlighted errors. Data structures and functions are standard across HLSL but I reckon it's the variables that separates one shader written for Unity and one for Reloaded for example.



You would expect since it's sent to hardware that shader code would work across different editors but it appears to be its compiled by the engine in it's own way before the data is sent to the graphics card.



I studied these shaders and previous scrolling texture shaders by bond1 and found he put the scroll code into the fragment shader rather than the vertex shader (with a really clever little looptimer to prevent jittering), it can be one or the other, still I have no idea if it's scrolling anything without a visual after compiling and the engine will only display black if it's not happy with it. I didn't mess with any of the stuff that Reloaded expects to run a shader and tried to be sure anything I added didn't break anything already in there. Obviously I have but no idea what, or certain named variables Reloaded expects are missing in my additions.



This leaves me nowhere to go if I can't pin down an error easily, I am no coder but I realise the benefits to an Artist who learns how it works to create more interesting media. I already did some nice shader effects for Classic but these shaders are well advanced from that.



What I and others need here is a properly updated Darkshader to edit the shaders with a visual on the effect as we do it, it doesn't help if it compiles without error but the engine say's no.



Another case of WYSISWYG that The TGC team are keen to promote for features in Reloaded, I can wait till performance is top notch and willing to pay more for such a thing

Lee-"...and before you know it you're a shader coder!"



rolfy-"Coding...To me this is the Dark Arts..don't blame me when something Evil comes to claim y'all if I dabble in it"
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 13th Mar 2014 17:51
DarkSHADER was not really designed to be a companion to Reloaded, but it's a good idea that we start that work at some point so you can prototype your shader ideas in a separate tool before they move into the Reloaded universe. Alas Paul, the original author, is busy with AGK V2 but I am sure we can find someone to do the required tweaks (someone needs to remind me by email after the next beta release).



If you really want to work on shaders while you wait for better pipeline support for shader working, the best way is to break out a copy of Dark Basic Pro and create a very simple program which loads your object, applies the shader and textures and then code from there. The Scene Commander has much experience with creating prototypes in this way, and the application of the shader is effectively just a few commands LOAD EFFECT, SET OBJECT EFFECT, LOAD IMAGE, TEXTURE OBJECT Object Number, Stage Number, Image Number.



This will allow you to try out shaders and tweak quickly, and then you have something you can bring into reloaded as a unique entity and custom shader when the time comes. remember to use the Entity_Basic.fx as a template and bear in mind that this shader is HEAVILY under development so do not depend on the template remaining as fixed until V1. For example, it has already been substantially modified for the LOWEST technique to get better performance.

PC SPECS: Windows 7 Ultimate 64-bit, Intel Core i7 920, NVIDIA Geforce 650GTX Ti Boost 2GB GPU, 6GB RAM

rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 8th Apr 2014 03:53 Edited at: 8th Apr 2014 04:33
Wouldn't ya know it.....you leave it alone for a bit and it takes all of fifteen minutes to get it working when you come back to it.



http://fpscrforum.thegamecreators.com/?m=forum_view&t=208257&b=8&p=0



A classic case of trying to be too clever for my own good
raymondlee306
15
Years of Service
User Offline
Joined: 24th Oct 2009
Location: Ohio
Posted: 9th Apr 2014 02:35 Edited at: 9th Apr 2014 02:36
Rolfy, Have you tried Nvidia FX composer 2.5? It's free (I think, haven't fully read the EULA) and I can open the fx files from reloaded, but not the .X Models. Says they are not formatted correctly. But may help guide you to a solution.



https://developer.nvidia.com/fx-composer
rolfy
18
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 9th Apr 2014 03:13 Edited at: 9th Apr 2014 03:13
Quote: "Loading the entity_basic.fx into Shader fx or FX composer and compiling, will return a bunch of highlighted errors"
.



I just about have it now anyway, but thanks

Login to post a reply

Server time is: 2024-11-24 03:07:03
Your offset time is: 2024-11-24 03:07:03