Source Shader Editor, a WYSIWYG shader editor from our frien

Grab your favourite IDE and tinker with the innards of game engines

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby -=Biohazard=- on Mon Jul 25, 2011 10:36 pm

deadpixel wrote:I am taking a rather chaotic approach to learning this...I just start connecting dots and seeing what happens. lol

Here are my nodes for the rays http://dl.dropbox.com/u/10645923/firearms/nodeview.jpg don't laugh too hard. I am sure there is an easier way to do everything I am doing here and still yield better results.


Texture transform builds a matrix on the fly, it's super expensive, don't use it inside a loop :P
Is there anything you find wrong with the postproc_sunrays canvas that you tried to solve with this approach? It's really just the straightforward way I guess, but you could prbly google some other methods, I didn't base it off any paper or w/e. You should also use the skymask for masking, or did you have problems with it? It needs to be enabled in shadereditorsystem.cpp.

deadpixel wrote:I have done some reading up on HLSL over the past couple days but I find it confusing translating what I read to the editor. It is like I am learning from two ends and will eventually meet in the middle.


Well the functions that are present in normal hlsl too are really the same, and the nodes that are unique to source and stuff are very shortly explained on the wiki.

deadpixel wrote:Are there any plans to possibly be able to import existing .fx files?


Nah, way too unlikely to even get that working flawless for everything.

deadpixel wrote:Also, for organization purposes, do you think it is possible to add collapsible frames? Something like the loop container that can be labeled and when collapsed will hide every thing contained inside.


Maybe some day, guess why the graph has a tab on the top left :) .

deadpixel wrote:Edit: Are there any plans to be able to apply multiple post-process shaders at once?


I considered that as well, but after all you're meant to implement the shaders later for real, the preview is just ... a preview.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby deadpixel on Mon Jul 25, 2011 11:50 pm

-=Biohazard=- wrote:Texture transform builds a matrix on the fly, it's super expensive, don't use it inside a loop :P
Is there anything you find wrong with the postproc_sunrays canvas that you tried to solve with this approach? It's really just the straightforward way I guess, but you could prbly google some other methods, I didn't base it off any paper or w/e. You should also use the skymask for masking, or did you have problems with it? It needs to be enabled in shadereditorsystem.cpp.


With 'postproc_sunrays' I get the purple checkers since skymask isn't enabled but the effect still shows even when indoors and doesn't seem aware of occlusions from buildings and such. I will see if my programmer can enable the skymask so I can test it properly.

I am coming at all of this as an artist and have no programming experience beyond HTML/CSS and math is not my strong suit. So some of these things, like "_rt_SmallFB1" (which now I am assuming is what gives the smaller FB) in texture sample elude me. But the more I tear down your examples the more I am understanding.

Really looking forward to the 1D/2D array node. I am on a mission to achieve a decent blur.


Edit: Also, I know it is possible to do "float4x4 WorldViewProjection" with the matrix node, but is there a "float4x4 WorldView"?
deadpixel
Dumpling
Dumpling
 
Joined: Mon Jul 25, 2011 6:05 pm

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby -=Biohazard=- on Tue Jul 26, 2011 3:03 am

deadpixel wrote:With 'postproc_sunrays' I get the purple checkers since skymask isn't enabled but the effect still shows even when indoors and doesn't seem aware of occlusions from buildings and such. I will see if my programmer can enable the skymask so I can test it properly.


Yeah it needs to be implemented right or will be missing/broken.

deadpixel wrote:I am coming at all of this as an artist and have no programming experience beyond HTML/CSS and math is not my strong suit. So some of these things, like "_rt_SmallFB1" (which now I am assuming is what gives the smaller FB) in texture sample elude me. But the more I tear down your examples the more I am understanding.


I'm sure it's kinda difficult then, especially since I wanted more flexibility and exposed both shaders how they are, that's a bit less user friendly than other editors have it.

"_rt_SmallFB1" just reads the bloom texture iirc, won't work w/o hdr on the map. To render to a smaller rt or apply blur in multiple passes and whatnot you'd need to implement it via code right now.

deadpixel wrote:Really looking forward to the 1D/2D array node. I am on a mission to achieve a decent blur.

Edit: Also, I know it is possible to do "float4x4 WorldViewProjection" with the matrix node, but is there a "float4x4 WorldView"?


WorldView would be model x view; there's no pre-multiplied matrix since model shaders all need skinning, so they need their own world transform.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby deadpixel on Tue Jul 26, 2011 5:52 am

Hmmm, maybe I should learn the basics on the code level first. Any good beginner tuts and the like?
deadpixel
Dumpling
Dumpling
 
Joined: Mon Jul 25, 2011 6:05 pm

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby deadpixel on Wed Jul 27, 2011 3:57 am

I was messing around with your lit sphere example and was wondering how it would handle a model with multiple UV maps.
deadpixel
Dumpling
Dumpling
 
Joined: Mon Jul 25, 2011 6:05 pm

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby -=Biohazard=- on Wed Jul 27, 2011 10:12 am

deadpixel wrote:I was messing around with your lit sphere example and was wondering how it would handle a model with multiple UV maps.


Actually there never are multiple UVs at once in a shader. Source splits the mesh on compile and yet another time on-the-fly into batches, so you never have different UVs/textures in a shader really.

Solely lightmapped stuff uses the additional texcoord input for actual texture lookups later iirc.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby stoopdapoop on Wed Jul 27, 2011 10:55 am

biohazard, how do you recommend learning shader authoring? did you come across any really good books/descriptive tutorials?
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby -=Biohazard=- on Wed Jul 27, 2011 1:37 pm

stoopdapoop wrote:biohazard, how do you recommend learning shader authoring? did you come across any really good books/descriptive tutorials?


I never read any books or anything so I can't really give you a hint there, I just looked over valves shaders more or less :?
Though this page proved invaluable for me at the beginning.

The only part I found difficult were matrices in HLSL since they are column major to save up some constants for frequently used 3x4 stuff and that means you have to transpose them for shaders first to get the desired result.
And along with that it's advantageful to know which values to expect after transforming vectors from one space to another I guess, but otherwise most functions should be self-explanatory I think.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby deadpixel on Wed Jul 27, 2011 11:37 pm

The problem I have with the that page is while it lists the functions it doesn't show them in context. As with learning any language context is everything.

I found this page which breaks things down line by line for a basic sepia filter. The code excerpts are a bit corrupt but still managed to follow it. I'd love to find a complex shader construction explained from end to end, covering the use of multiple shaders and other files (C++). As a visual learner I am certain that would help me grasp stuff so much more.
deadpixel
Dumpling
Dumpling
 
Joined: Mon Jul 25, 2011 6:05 pm

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby gladers on Sat Jul 30, 2011 12:35 am

This is really well done. The only problem im having so far is missing texture files.

Image

This is the ingame view after caching (It works correctly in the preview window).

I have this in the vmt file for the model:

Code: Select all
"editor_shader"
{
   "$shadername" "model_chromatic_aberration"
}


Anything else i need to add to get this missing texture to work? I also have the same problem with the texture missing for filmgrain.
gladers
Member
Member
 
Joined: Sat Feb 27, 2010 2:53 pm

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby Armageddon on Sat Jul 30, 2011 1:03 am

I think you need a cube map?
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby -=Biohazard=- on Sat Jul 30, 2011 12:08 pm

Armageddon wrote:I think you need a cube map?


Yeah, you need to compile them and probably also add $envmap env_cubemap to the vmt. Filmgrain uses the parameter $noise iirc, so you'd have to specify that; although I thought it should load the default texture, did you copy the texture_samples directory properly? You can also check the console to see which texture it tried to load but couldn't find etc.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby gladers on Sat Jul 30, 2011 5:28 pm

I get this console message for the grain used on the nightvision (works perfect in preview, not deployed):

Binding uncached material "dvh_nightvision", artificially incrementing refcount
"materials/.vtf": can't be found on disk


Materials are installed correctly, it looks like its trying to load the grain material as .vtf

Any ideas what to try next? An example would be nice too, my knowledge of all the parameters within vmt files is not that great.

This is what i have in the vmt file so far:

Code: Select all
"editor_shader"
{
   "$shadername"   "dvh_nightvision"
}


[img]
http://cloud.steampowered.com/ugc/54177 ... 5F7AC2EE6/
[/img]
The rest of the shader is working correctly, the grain has the big squares from missing texture. The only change i made was the nightvision coloring.
gladers
Member
Member
 
Joined: Sat Feb 27, 2010 2:53 pm

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby -=Biohazard=- on Sat Jul 30, 2011 7:28 pm

Open the texture sampler nodes to find out which parameter they are linked to and then use that parameter in the vmt file + the texture.

You should also be able to specify the default texture in the bottom left textbox, but apparently that didn't work out in your case, maybe there was something going wrong. On the other hand I don't think that I defaulted it to the grain texture to begin with.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Source Shader Editor, a WYSIWYG shader editor from our f

Postby gladers on Sat Jul 30, 2011 8:52 pm

Im not exactly sure how. This is the node details, general tab is empty:
Image
gladers
Member
Member
 
Joined: Sat Feb 27, 2010 2:53 pm
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users