FXED - Effect Editor - BETA

Posted By: DJBMASTER

FXED - Effect Editor - BETA - 07/27/10 00:38

Hey guys, here's my entry for the tool contest. In keeping with gamestudio's naming style (WED, MED, SED) this one is called FXED.

It's an effect editor allowing you to write and preview shaders along with changing skins, setting skills and editing materials at runtime.

It uses a 'component' model where each pass, variable, vector, sampler, etc is treated as a seperate object with customizable properties...



Or for those who prefer the traditional way, individual .fx files can be edited...



Additionally an effect library is included with contributions from the wiki, massive shader collection, etc. You can also add any of your own shaders to the library and share them with each other.
For now I've just added some basic shaders for this BETA test, in case there are major flaws in the file format. Many others will be added before the contest deadline...



Also included is a 'HLSL Primer' which is a mini workshop on the basics of the shader language.
It is written how I personally understand HLSL, and as I'm not really a shader programmer, any gurus who find anything wrong with it please don't hesitate to correct me.

And here is the download link...

FXED Effect Editor V1.0

It's written in C# so you will need the .NET framework (3.5+) if you don't already have it.
Please read the included help file for a complete description of the features.
For now I've just included some basic models to test.

It's quite a complex piece of software so bound to have a few bugs. I'd appreciate any feedback on bugs, features, etc.
This gives me just under a week to fix anything...

Hope it works, knowing my luck it'll crash on startup! crazy

Thanks, DJB.
Posted By: bk9iq

Re: FXED - Effect Editor - BETA - 07/27/10 03:51

Great contribution bro...
However as u said
Quote:
knowing my luck it'll crash on startup!

Hehehe.. you are right ... I tried it and once I clicked on one of the library files it crashed...
I have .NET framework 4 ... but I use 3DGS free edition ... Does it depend on the version?? because if yes then this is why as the free and extra editions don't support shaders...
Thanks again
Posted By: JibbSmart

Re: FXED - Effect Editor - BETA - 07/27/10 04:42

I haven't produced anything yet, as I have other stuff on my plate at the moment. But I snooped around the interface and absolutely love it. Everything is laid out in front of me, and it is really nice to have a list of intrinsic functions, render states, default.fx functions and what-not.

I was debating in my head the usefulness of such a program for multi-stage pp effects, and then I remembered how many times I've wanted to be able to see the output of each individually anyway, so I see its use there.

The preview window is very helpful, and being able to load in my own model and see the effects straight away was very gratifying. However, there are sorting errors for complex models, and changing the render states (making sure ZEnable and ZWriteEnable are True, and setting ZFunc to LessEqual) did nothing to help. Setting a Sky Cube makes the preview model invisible -- but only with the Normal Mapping example. Sorting errors are prevalent in all examples I tried. I wish I could tell you more.

Three additions that would be nice:
1. Multiple Techniques. I might be blind, and just couldn't find it, but there didn't seem to be a way to have multiple techniques in the one file. Fallbacks can be really useful, as well as the automatic LOD system with techniques, so it's a shame that isn't there.
2. Rotating the model in the preview window with mouse can be really awkward. The panning works great, but the tilting only corresponds appropriately with mouse motion when the model faces the camera. You may want to use quaternions to remedy this, or perhaps it's no big deal. But one more thing that's related to this: When loading new media (or perhaps just when clicking "reset camera"), it would be nice if the camera position took the model's bounding box into account (it can be a little annoying to load a large model and have it either fill the screen, or overlap the camera). Also, it doesn't seem to detect smallish mouse movements -- I suspect this is because of an enormous framerate causing time_step to round down to zero. Perhaps there should be a cap on the framerate?
3: For pp effects, it would be really nice to be able to use a preview image instead of a preview model.

Anyway, well done! This contest is already earning some really cool tools for the community! I can see myself enjoying it as a .fx editor more than anything else; being able to separate the pixel and vertex shaders into their own independent windows is tidy and charming, but I found myself lost not being able to see the input and output at a glance. I'm sure shader programmers who learn in this software will be able to appreciate it more than I can at the moment.

Jibb
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 05:46

Thanks for your feedback.

@bk9iq > I'm not quite sure why it would crash when loading a library file? Maybe you could provide a more detailed explanation? It doesn't take your gamestudio version into account at all, it uses its own version of the engine so everyone can use it smile

@JulzMighty > Setting a skycube shouldn't affect the model at all. I just tried setting a sky image on the normal mapping shader and I didn't see anything abnormal. Maybe I'm blind!

As for your additions...

1) Yes currently only 1 technique is generated, but a fallback is also written so it's not all bad! tongue. Maybe if I add an option that allows you to assign a technique name to each pass to allow different versions?

2) As tilting I assume you mean dragging with the left mouse button? I use this small code...
Code:
model.pan += orbit_speed * mouse_left * mouse_force.x * time_step;
model.tilt -= orbit_speed * mouse_left * mouse_force.y * time_step;


I agree with the 'bounding box' issue. I didn't implement any mechanism to adjust the camera based on the size of the model. This is due to my poor testing and using models with similar size.
Thank you for bringing this to my attention.

The small mouse movements is because the camera is moved at a fixed rate, so the bigger the model the smaller the movement.

3) Assuming I understand you correctly, I'll add an option to load an image as a panel on the screen.

The 'component' model approach may be a little akward for a more mature programmer but I feel newcomers to the shader programming scene will appreciate a visual interface more.
So I suggest that shader newcomers should use the designer to get a feel with how each bit fits in and then maybe branch off into writing .fx files from stratch.

Regardless, the overall goal is to get more people interested in shader programming because, in my opinion, there tends to be a sort of fear of shader programming because of how complex and mathematical they can get.

I'm a noob myself but I feel learning something new is much more interesting with a visual app.

Thanks for your suggestions.

Posted By: JibbSmart

Re: FXED - Effect Editor - BETA - 07/27/10 06:35

Quote:
@JulzMighty > Setting a skycube shouldn't affect the model at all. I just tried setting a sky image on the normal mapping shader and I didn't see anything abnormal. Maybe I'm blind!

I just started again in the hopes of showing you a screenshot, and the skycube is no longer causing any trouble. That's just weird. But good laugh

But the sorting errors are still there: You should be able to see it with the normal mapping example and using the marine (since it has overlapping parts), regardless of whether or not a skycube is present. Here's what I mean:

Notice how the back leg appears over the front leg.
Quote:
2) As tilting I assume you mean dragging with the left mouse button? I use this small code...
Code:
model.pan += orbit_speed * mouse_left * mouse_force.x * time_step;
model.tilt -= orbit_speed * mouse_left * mouse_force.y * time_step;


Yup, I thought it would be something like that. It works great when the model faces the camera (up tilts it up, down tilts it down), but when the model faces side-on from the camera, or away from it, tilting the front of the model up when the mouse moves up is unintuitive. It's really just a minor nit-pick.
Quote:
Regardless, the overall goal is to get more people interested in shader programming because, in my opinion, there tends to be a sort of fear of shader programming because of how complex and mathematical they can get.
Too right. It's especially sad here since shader programming is IMO a big strength of GS's. I think your tool would be a great way to start and get an interest, and also to continue developing. Good luck in the contest.

Jibb
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 07:02

Ok, At first look I though it was a render state being set by accident but it is this piece of code...
Code:
model.alpha = [alpha value from material settings];
set(model,TRANSLUCENT);


But by default the material alpha is 100, and even when the model is translucent and alpha is 100, it should still be completely opaque. Strange.
Posted By: Liamissimo

Re: FXED - Effect Editor - BETA - 07/27/10 08:41

I tried to start it but if I am selecting Entity Effect and not Post-processing it crashes wink
Posted By: Rei_Ayanami

Re: FXED - Effect Editor - BETA - 07/27/10 10:03

The Default alpha Value in 3dgs is 50 ...


However,Looks really good laugh
Posted By: Hummel

Re: FXED - Effect Editor - BETA - 07/27/10 10:10

going to try this next week wink
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 10:14

Originally Posted By: Rei_Ayanami
The Default alpha Value in 3dgs is 50.


Yeh I know, but it makes no sense that setting alpha to 100 along with the TRANSLUCENT flag results in seeing some of the backfaces.
Posted By: Razoron

Re: FXED - Effect Editor - BETA - 07/27/10 12:29

Entity-Shader -> Crash
Post-Processing Shader -> Crash
Open a .fx file -> Crash
Open a file from shader library -> Crash

All windows have been created, then it crashs.

It works on other pcs, so gogo and fix this. laugh

EDIT: Windows 7, 64 bit, Q6700, geforce 9600 GT, Intel Q6700 (4x2.666 Ghz), .NET Framework 4.
Posted By: Slin

Re: FXED - Effect Editor - BETA - 07/27/10 13:39

Same as above. Which means, that I canīt test any further.
Win 7, 64bit, I doubt that the hardware matters but just in case: nvidia 8800gs, intel i5 640, 4gb ram

Quote:
Yeh I know, but it makes no sense that setting alpha to 100 along with the TRANSLUCENT flag results in seeing some of the backfaces.

As soon as you set TRANSLUCENT, writing to the depthbuffer is disabled, which causes that behavior. This means that one weather have to sort the triangles, which gamestudio doesnīt, or one finds an alternative solution which works in combination with depth testing. The second is kinda tricky and the first is kinda slow wink.
Posted By: bk9iq

Re: FXED - Effect Editor - BETA - 07/27/10 16:23

Quote:
@bk9iq > I'm not quite sure why it would crash when loading a library file? Maybe you could provide a more detailed explanation? It doesn't take your gamestudio version into account at all, it uses its own version of the engine so everyone can use it smile

Well it crashes whatever I open just as Razoron said

Quote:
Entity-Shader -> Crash
Post-Processing Shader -> Crash
Open a .fx file -> Crash
Open a file from shader library -> Crash


I am using Windows 7 64bit ...
spec just in case it matters: Intel C2D P8700 2.53 GHz , nVidia GTX 260M ...
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 18:53

Hmm this has to be a win7 issue, either that or because you are running 64-bit systems, although I don't see how that should affect it?

On second thoughts it may be because I'm using the 32-bit version of DevIL where as it would probably need the 64-bit version on x64.

I don't have access to a win7 PC so I can't test it frown.
Posted By: JibbSmart

Re: FXED - Effect Editor - BETA - 07/27/10 19:09

My PC is 32-bit Win7.

Jibb
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 19:17

Ahh ok its a 64-bit issue then.
Posted By: Xarthor

Re: FXED - Effect Editor - BETA - 07/27/10 19:30

Crashes when selecting post-processing or entity shader (I just tested post-processing).
OS: Win7 Pro 64bit
Error details (perhaps they are useful?)
Quote:

Problemsignatur:
Problemeventname: CLR20r3
Problemsignatur 01: fxed.exe
Problemsignatur 02: 1.0.0.0
Problemsignatur 03: 4c4e2592
Problemsignatur 04: FXED
Problemsignatur 05: 1.0.0.0
Problemsignatur 06: 4c4e2592
Problemsignatur 07: 14
Problemsignatur 08: 0
Problemsignatur 09: System.BadImageFormatException
Operatingsystemversion: 6.1.7600.2.0.0.256.48

Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 19:48

Ok for those who it crashed for, can you try downloading it again. Testing with a friend has helped identify the problem (hopefully eek).
Posted By: Rackscha

Re: FXED - Effect Editor - BETA - 07/27/10 19:56

Loading and running fine on Win7 Ultimate 64BIT(!).

Net framework 4 installed.
(maybe a VCredist is needed too?!)

I have no problems, so its no 64bit only problem.
I guess its a system configuration problem.


GReets
Rackscha
Posted By: bk9iq

Re: FXED - Effect Editor - BETA - 07/27/10 20:01

Great ... it is working now.... no crashes .... thanks
Posted By: Rackscha

Re: FXED - Effect Editor - BETA - 07/27/10 20:06

so, missing vcredist has bene the problem?
Posted By: Rei_Ayanami

Re: FXED - Effect Editor - BETA - 07/27/10 20:09

DJBMASTER has already fixed it before you wrote that it works for you!
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/27/10 20:12

no, the problem was setting the compiling target to use 'ANY CPU' this means that running on 32-bit everything will run in 32-bit, and on 64-bit the runtime will try to execute it as 64-bit code even if it was meant to be 32-bit.

So I force the code to compile as x86 ensuring that running code on 64-bit runs it in 32-bit more and doesn't try to 'upgrade' it to 64-bit.

It's just something I forgot about, lol, but didn't have a 64-bit machine to test so I asked my friend.
Posted By: Rackscha

Re: FXED - Effect Editor - BETA - 07/27/10 21:44

?!
Ah okay didnt read carefully enough:

"Ok for those who it crashed for, can you try downloading it again. Testing with a friend has helped identify the problem (hopefully eek)."



Greets
Rackscha
Posted By: Blink

Re: FXED - Effect Editor - BETA - 07/28/10 01:38

can us A6er's use this as well. I dont want to download it if i cant play with it.
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/28/10 04:45

yeh sure you can it uses it's own engine version. Shader code is pretty much the same for both a6 and a7/a8.
Posted By: Blink

Re: FXED - Effect Editor - BETA - 07/28/10 14:29

Thanks, I will try it when i have some time, and can get the .net framework.
Posted By: JoGa

Re: FXED - Effect Editor - BETA - 07/30/10 13:41

I tested your tool on my PC, but it doesn't work.
I have installed Microsoft .NET framework4 Client Profile.
The error is the same like above - the programm runs but after I choose a button (entity shader, post shader, library) it crushes:
(Windows Vista 32Bit)
Quote:
Beschreibung:
Stopped working

Problemsignatur:
Problemereignisname: CLR20r3
Problemsignatur 01: fxed.exe
Problemsignatur 02: 1.0.0.0
Problemsignatur 03: 4c4f3667
Problemsignatur 04: FXED
Problemsignatur 05: 1.0.0.0
Problemsignatur 06: 4c4f3667
Problemsignatur 07: 20a
Problemsignatur 08: c
Problemsignatur 09: System.DllNotFoundException
Betriebsystemversion: 6.0.6001.2.1.0.768.3
Gebietsschema-ID: 1031

Posted By: Rackscha

Re: FXED - Effect Editor - BETA - 07/30/10 14:05

year, as written in your errorlog:

DLL not found.

Means something is missing on you system.

I have Netframework 4.0 clientprofile and Extended on my PC
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 07/31/10 01:18

@JoGa, The other user's errors were caused by 'System.BadImageFormatException' which was my fault. Your's is 'System.DllNotFoundException' which means you are missing a dependent on your system.

You could try re-installing .NET 4.0 and downloading FXED again, and try again.

Thanks.
Posted By: TechMuc

Re: FXED - Effect Editor - BETA - 08/06/10 20:42

@DJBMASTER: Only technical question (sorry, does not have the time to test the program completly): Are you using the scintilla library for syntax highlightning and coloring?

Greetings,
Timo

PS: Even with no testing, the program looks very impressing. Though as I'm no real gamestudio user anymore i can not use it =)
PS2: Just as a small notation: the reloading of the effect when changing effect values is a little bit annoying.. i'm pretty sure that this can be achieved automatically laugh
Posted By: DJBMASTER

Re: FXED - Effect Editor - BETA - 08/06/10 21:43

Hi TechMuc, no the syntax highilighting component is based off an article from code project. As you know syntax coloring is pretty complicated so I took an existing component and modified it.

I've heard of scintilla but never really looked into it. Did you use it for LED?

As for PS2, if you go into Edit > Options there is a 'Recompile effect on changes' you can toggle wink.

Thanks again.
Posted By: Quad

Re: FXED - Effect Editor - BETA - 08/09/10 14:15

which one is the fixed version again? i am downloading from the first post, it still crashes on win7 64bit.
© 2024 lite-C Forums