I got this code semi-working in my game but the snag is that the upper outer atmosphere has a very hard edge to it as opposed to the dithered edge in your video. Any thoughts about why that might happen?
@zer0sumGames hmmm, not without seeing your implementation really, the original sample was double rendering, if you are still doing that, try removing it, but you will then have to play about with the intensity of the out put...
I have been messing around with your XNA implementation of this and found some strange things going on. For example, you have a for loop that executes effect.CurrentTechnique.Passes.Count times but all that seems to do is render all five passes five times each additively. If you run it once instead, it does all five stages of the shader. It doesn't look as awesome but you can have the shader do the clouds two or three times to brighten them up or something. Seems wasteful to do it all 5 times.
Thanks for the super fast reply :D. After disabling the frame rate limiter I tested the performance difference caused by eliminating the extra renders and there was a significant difference. Interestingly, the planet doesn't look as good with only one render. All the components are there but it's missing brightness and contrast. Using three passes of the cloud code doesn't hit performance much but brings back a lot of the brightness qualities. And adding texture mipmaping makes it look smooth.
Yes, took the loop from another shunk of code. Remove the loop. You can raise the brightness on the clouds by doing this in the shader output.Color = (clouds + cloudsN) * 2;
Having ran it now, I really don't like this shader now lol, must do better in future..
Yeah, I made the same adjustments and it looks a lot better. I also removed the specular as it seems to look bad on planets. Do you mind if I use this shader in a project I'm working on? I may write my own eventually but yours is good for my purposes and runs pretty fast. If you do write a new one, post a video! I'd be very interested to see it.
This is pretty cool, do you have the shaders up for download at all? Is this something i can follow as a tut using renderMonkey? i'm not the greatest shader coder lol
Hey i'm curious, i have this shader used to render planets and atmosphere, no clouds or anything, what it does is shade the planet and atmosphere from space, as well as on the surface. I want to get atmospheric scattering implemented into it but i'm not a good shader programmer like i said, think maybe you'd be able to help?
It does, kind of, but not the way i want, i've got an article from gpu gems 2 wich does what i want but its in glsl, i need hlsl, these two effects i have are similar but i cant figure out how to implement the changes into what i've got here. I can message you with the links if you like
Oh i'm sure it is really, my main issue is that i dont know what the differences are, or even how to start trying to convert. What i'm really looking for is someone who can help me upgrade my current shader to include these effects.
Sweet Mr NemoKradXNA Sir..! Very polished. Particularly like the scatter effect. Now, if you combine it with DrJNB's last "rays" code and plant the camera on the moon (with some topology). Et Voila... "Earth Rise!". Best done to "Apollo and Atnospheres" by Brian Eno of course!
I have already done a post on finite state machines, but it was quite basic. I do plan on expanding on A.I and giving a more useful example in the future.
I got this code semi-working in my game but the snag is that the upper outer atmosphere has a very hard edge to it as opposed to the dithered edge in your video. Any thoughts about why that might happen?
zer0sumGames 2 months ago
@zer0sumGames hmmm, not without seeing your implementation really, the original sample was double rendering, if you are still doing that, try removing it, but you will then have to play about with the intensity of the out put...
NemoKradXNA 2 months ago
x-com
defragen1 8 months ago
@defragen1 lol, yes, I loved that game..
NemoKradXNA 8 months ago
dude... that looks great!!
all the fine details like lit cities and moving atmosphere!
one thing you could add to make look even better: auroras on the north and southpole!!
pandora2043 2 years ago
I have been messing around with your XNA implementation of this and found some strange things going on. For example, you have a for loop that executes effect.CurrentTechnique.Passes.Count times but all that seems to do is render all five passes five times each additively. If you run it once instead, it does all five stages of the shader. It doesn't look as awesome but you can have the shader do the clouds two or three times to brighten them up or something. Seems wasteful to do it all 5 times.
Nyphur 2 years ago
Been a while since I did this, will take a look, may be a malformed loop from me copying code from one project to the next...
NemoKradXNA 2 years ago
Thanks for the super fast reply :D. After disabling the frame rate limiter I tested the performance difference caused by eliminating the extra renders and there was a significant difference. Interestingly, the planet doesn't look as good with only one render. All the components are there but it's missing brightness and contrast. Using three passes of the cloud code doesn't hit performance much but brings back a lot of the brightness qualities. And adding texture mipmaping makes it look smooth.
Nyphur 2 years ago
Yes, took the loop from another shunk of code. Remove the loop. You can raise the brightness on the clouds by doing this in the shader output.Color = (clouds + cloudsN) * 2;
Having ran it now, I really don't like this shader now lol, must do better in future..
NemoKradXNA 2 years ago
Yeah, I made the same adjustments and it looks a lot better. I also removed the specular as it seems to look bad on planets. Do you mind if I use this shader in a project I'm working on? I may write my own eventually but yours is good for my purposes and runs pretty fast. If you do write a new one, post a video! I'd be very interested to see it.
Nyphur 2 years ago
Sure, use it wherever you like, as long as you credit the source I don't have a problem.
Yes, the specular is way to high, but you can adjust that too, or as you did, remove it :)
I have like a million and one things on at the moment, but if I do create another planet shader, like all my stuff I will post it :)
NemoKradXNA 2 years ago
I am downloading the sample now. In the shader I recall making a few adjustments for brightness. As I say, I'll take a look.. :)
NemoKradXNA 2 years ago
This is pretty cool, do you have the shaders up for download at all? Is this something i can follow as a tut using renderMonkey? i'm not the greatest shader coder lol
Indecom 2 years ago
Yes they are all on my blog, I am sure I put the link at the end of the clip, if not then go to my channel page and it will be on there.
I have not used many semantics so not sure if renderMonkey will like it much or FX Composer either.
Let me know how you get on with it :)
NemoKradXNA 2 years ago
Hey i'm curious, i have this shader used to render planets and atmosphere, no clouds or anything, what it does is shade the planet and atmosphere from space, as well as on the surface. I want to get atmospheric scattering implemented into it but i'm not a good shader programmer like i said, think maybe you'd be able to help?
Indecom 2 years ago
No idea, can you put up a clip of how it renders now?
NemoKradXNA 2 years ago
Yea i'll try and get one up real quick.
Indecom 2 years ago
Comment removed
Indecom 2 years ago
Comment removed
Indecom 2 years ago
alright it finally uploaded:
watch?v=x5jg80X1tWg
Indecom 2 years ago
hmm, it has atmos scatter, in fact it looks like actual scatter rather than the one on my clip which is actually fake lol
I don't realy understand what you want to do with it?
I am sure Dark GDK supports shaders so you should be able to use my shader from the blog.
NemoKradXNA 2 years ago
It does, kind of, but not the way i want, i've got an article from gpu gems 2 wich does what i want but its in glsl, i need hlsl, these two effects i have are similar but i cant figure out how to implement the changes into what i've got here. I can message you with the links if you like
Indecom 2 years ago
No I have the book too.
glsl is very similar to hlsl you should be able to port easily..
NemoKradXNA 2 years ago
Oh i'm sure it is really, my main issue is that i dont know what the differences are, or even how to start trying to convert. What i'm really looking for is someone who can help me upgrade my current shader to include these effects.
Indecom 2 years ago
What's the salary like? lol
Mail me the stuff you have and I'll take a look when I have time.
NemoKradXNA 2 years ago
Thanks for posting these tutorials... they are absoluteley awesome!
jogra028 2 years ago
Sweet Mr NemoKradXNA Sir..! Very polished. Particularly like the scatter effect. Now, if you combine it with DrJNB's last "rays" code and plant the camera on the moon (with some topology). Et Voila... "Earth Rise!". Best done to "Apollo and Atnospheres" by Brian Eno of course!
duckocide 2 years ago
Wow! Thanks, compliment indeed :D
Not sure how I would use the ray's in an earth rise, but might just do something like that :D Good idea..
NemoKradXNA 2 years ago
I was thinking you could do an Earth rise and have the earth eclipse the sun.
duckocide 2 years ago
I get you I think.... might not get much of a view of the earth render though with all that sun light :P
I'll have a play and see what I come up with..
NemoKradXNA 2 years ago
Awesome. Looks great but the second atom scatter doesn't look quite right. Should it stop so suddenly, maybe a fade would be better?
BlackSpiderWolf 2 years ago
Yes, as I say in the clip, was playing with it and didn't feel it fully worked as I wanted it to.
Will play with it some more, I guess once I have put my post up on the blog you can have a look at the source and see what you can come up with :)
NemoKradXNA 2 years ago
That will be awesome. I'm really
interested to see how you've created the atmosphere, so I'm definitely going to be playing with it. :)
BlackSpiderWolf 2 years ago
I am cheating...
NemoKradXNA 2 years ago
Code is up on the blog now, check it out.
NemoKradXNA 2 years ago
Great, Thanks for reminding me I got lost debugging some A.I. I'll check it out now :)
A bit off topic from this video but are you planing on making any tutorials on A.I.?
BlackSpiderWolf 2 years ago
I have already done a post on finite state machines, but it was quite basic. I do plan on expanding on A.I and giving a more useful example in the future.
NemoKradXNA 2 years ago
Cool, I look forward to that.
At the base of my A.I. is a FSM but I'm currently working on Avoidance/steering and A* pathfinding but there are very few tutorials out there.
As for the atmosphere I was wrong to judge it on youtube :) it looks awesome "in real life"
After messing around with it for a bit I couldn't get any better results..
Oh and cheating is such a harsh word. :)
BlackSpiderWolf 2 years ago
Well it's the truth lol!
Glad you like the sample, and it looks better "in real life"
NemoKradXNA 2 years ago
really nice!
gtxx 2 years ago
Thanks :)
NemoKradXNA 2 years ago