Jump to content

Erosion Effects


lynbo

Recommended Posts

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Yes all surface shader

24179[/snapback]

Nice work there Sven! :)

But how can you guys work with VOPs when things get somewhat involved like in Sven's case?

This is not at all a criticism (the shader obviously works fine and is a very nice one), I'm simply curious... I would find it almost impossible to maintain the resulting visual spaghetti (not to mention the catastrophic effects of plugging/unplugging inputs to sub-networks and in-line vops).

I know this is just a case of personal preference and really doesn't matter (unless someone else has to maintain it as well that is), but would the equivalent ~50 lines (just a guess) of clean VEX code be scarier to look at? :blink:

Sorry... having a bit of a lazy Friday and had a sudden evil urge to hijack a good thread with a pointless post :P :thumbdown:

Cheers!

Link to comment
Share on other sites

This is 'hypertexture' shader, right? This is the first time I've seen someone doing this. I've only seen it in books prior. Good job, Sven. :) That's something for me to learn too!

Yeah, I guess with a full-blown, complex production shaders, I'd definitely enroute VEX coding over VOP. However, in geometry context, I'd still favor VOP for its rapid feedback. :D

Thanks!

Alex

Link to comment
Share on other sites

Nice work there Sven! :)

But how can you guys work with VOPs when things get somewhat involved like in Sven's case?

This is not at all a criticism (the shader obviously works fine and is a very nice one), I'm simply curious... I would find it almost impossible to maintain the resulting visual spaghetti (not to mention the catastrophic effects of plugging/unplugging inputs to sub-networks and in-line vops).

I know this is just a case of personal preference and really doesn't matter (unless someone else has to maintain it as well that is), but would the equivalent ~50 lines (just a guess) of clean VEX code be scarier to look at?  :blink:

Sorry... having a bit of a lazy Friday and had a sudden evil urge to hijack a good thread with a pointless post :P :thumbdown:

Cheers!

24192[/snapback]

Actually i prefer to write code too and yes i am really having a lot of problems with that visual spaghetti but the people on the chan are beating me out of irc if i dont do it in vops so that they understand it ( Hey Ratman and Sum][One :D ).

And now i am of to write that shader again in code and add some more advanced stuff that i really dont want to do with vops ( another if and for in there for substepping no thanks :P ).

Sven

Link to comment
Share on other sites

hey nice job..  I am also experimenting with the effect .. You manage to get the subtle deatiled ..

24205[/snapback]

It is just a fade from one .TGA to another. All 10 images were done with that WorldMachine.

Link to comment
Share on other sites

I don't quite get what this shader does, are you going to send it to exchange to let noobs study it's full version or is it just a teaser ? :)

About shaders, if a shader is written in vex code doesit need to be compiled and installed in order to be used? Then any change would force you o recompile reinstall?

I understand code can be less messy but is it as easy to change and control it with immediate visual feedback as VOPs?

Link to comment
Share on other sites

About shaders, if a shader is written in vex code doesit need to be compiled and installed in order to be used? Then any change would force you o recompile reinstall?

I understand code can be less messy but is it as easy to change and control it with immediate visual feedback as VOPs?

24211[/snapback]

Well, I don't want to spoil this thread so I'll just say: Yes, you need to recompile vex code (usually some tenths of a second), and you only need to reload if there's been a UI change (though even that is automatic on recooks for VOPs). But, even though I admit I'm the one guilty of having mentioned it to begin with, we should really save that discussion for a different thread.

My bad <_< sorry.

Link to comment
Share on other sites

Nice.

Anyone who has used both WorldMachine and Terragen willing to compare and contrast?

24208[/snapback]

I see World Machine as a hightmap or mesh creator, Terragen does the same and renders it, im not sure if you can export anything else.

WorldMachine's gallery is rendered on other softwares.

Link to comment
Share on other sites

Heres another version of the implicit surface shader this time code and at least for me it works better then the vops one.

Sven

#include &lt;voptype.h&gt;
#include &lt;voplib.h&gt;

float bias(float b,x;)
{
	return( pow(x,log(B)/log(0.5)));
}

float density_function(vector marchpoint,frequency,offset;
        float  roughness,attenuation,gain;
        int    turbulence;
        )
{
float density;

density = bias(gain,onoise(marchpoint*frequency-offset,turbulence,roughness,attenuation));
return(density);
}

surface Implicit(
     // Raymarching Parameters
     float maxdist = 20;
     float iso = 0.5;
     float step = 0.001;
     // density_function Parameters
     vector frequency = {1,1,1};
     vector offset = {0,0,0};
     float  roughness = 0.5;
     float  attenuation = 0.5;
     float  gain = 1;
     int    turbulence = 4;
     // shading parameters
     vector amb  = {0,0,0};
     vector diff = {0.5,0.5,0.5};
     vector spec = {1,1,1};
     float shinyness = 0.5; 
        	)
{
int front;
front = (vop_dot(I, N) &lt; 0.0) ? 1 : 0;

if ( front != 0 )
{

	vector marchpoint,marchdir,marchnormal,raydir;
	float  marchlength,density,currdist;
	marchpoint = P;
	marchdir = normalize(P-Eye);
	raydir =P+(marchdir*maxdist);
	marchlength=rayhittest(P,raydir,0.05);
	if ( marchlength &gt; 0.001 )
	{
  density=0;
  currdist=0;
  while ( density &lt; iso &amp;&amp; currdist &lt; marchlength)
  {
  	density = density_function(marchpoint,frequency,offset,roughness,attenuation,fit(gain,0,1,iso,1),turbulence);
  	currdist = distance(P,marchpoint);
  	marchpoint += marchdir*step;	
  }
  if ( density &gt;= iso)
  {
  // Shading
  	marchpoint -= marchdir*step;
  	if ( avg(marchpoint-P) &lt;= 0.01)
  	{
    marchnormal=N;
  	}
  	else
  	{
marchnormal=set(density_function(marchpoint-{0.001,0,0},frequency,offset,roughness,attenuation,fit(gain,0,1,iso,1),turbulence)-density,
  density_function(marchpoint-{0,0.001,0},frequency,offset,roughness,attenuation,fit(gain,0,1,iso,1),turbulence)-density,
  density_function(marchpoint-{0,0,0.001},frequency,offset,roughness,attenuation,fit(gain,0,1,iso,1),turbulence)-density);
  	}
  	marchnormal = frontface(marchnormal, I);
  	Cf = amb*ambient();
  	Cf += diff*diffuse(marchnormal);
  	Cf += spec*phong(normalize(marchnormal),-normalize(I),1-shinyness);
  	Of = {1,1,1};
  	Af = 1;	
  }
  else
  {
  // NoShading
  	Cf={0,0,0};
  	Of={0,0,0};
  	Af=0;
  }	
	}
	else
	{
	Cf={0,0,0};
	Of={0,0,0};
	Af=0;
	}
}
else
{
Cf = {0,0,0};
Of = {0,0,0};
Af = 0;
}
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...