ВНИМАНИЕ! Наша конференция посвящена космической тематике и компьютерным играм. Политические вопросы и происходящие в мире события в данный момент на нашем сайте не обсуждаются!
|
| » GIMP В процессе осваивания | страница 3 |
|
|
|
|
Канал творчества: «GIMP В процессе осваивания» |
|
|
|
XArgon
1425 EGP
        Рейтинг канала: 12(1752) Репутация: 395 Сообщения: 4153 Откуда: Интернеты Зарегистрирован: 06.08.2005
 |
|
Текстуры никакой нет. Всё "руками". Свечение - фильтр Supernova. Плюс, опять таки, руки - Dodge и Burn.
К слову, картинку уже давно доработал, разнообразил звёзды, поработал над освещением. Но пока не выкладывал, берёг для запланированной работы.
|
|
|
|
Варсик
547 EGP
    Рейтинг канала: 3(35) Репутация: 117 Сообщения: 4041 Откуда: Москва Зарегистрирован: 22.12.2002
 |
|
Гм... Научиться что-ли... А то я только "техник". Мне много и сразу...
_________________ WARNING: By reading this post you accept that this post is genius. |
|
|
|
Варсик
547 EGP
    Рейтинг канала: 3(35) Репутация: 117 Сообщения: 4041 Откуда: Москва Зарегистрирован: 22.12.2002
 |
|
Апну темку...
Набросал скриптик. Пока простой.
Работает так: Файл -> Создать -> Warstone -> Planet
- Убрал симметричность.
- Добавил рельеф
- Добавил цвет (как вариант - автогенерация градиента)
- {1.04} {28.07.2011} Переделал генерацию рельефа, теперь нету странной черты, вокруг планеты.
- {1.05} {29.07.2011} Скорость генерации базовой текстуры планеты увеличена ценой некоторой повторяемости, но что-бы ее найти надо... Сильно присматриваться на разрешении 2048+. Да, старый вариант остался. В последствии в основном скрипте будет настройка ("Качественно", "Быстро", "Быстрее бле@дь!!", "ФТРИСТА РАЗ!!!") )
- {1.05} {29.07.2011} Добавил еще один метод "Планетизации" через линзу. Он требует гораздо меньше ресурсов (вызывает генерацию текстуры планеты 1 раз, а не 2 и постобработка заметно проще) и работает гораздо быстрее, но, субъективно, результат хуже. То есть такой метод можно использовать для генерации кучи маленьких (128, ну 256) планеток. Более детализированные лучше делать старым способом.
|
Code v1.05 (кликните здесь для просмотра)
| Код: |
(define (warstone-surface-texture inImage inDrawable inSimply inNormalize) (
let* (
(drWidth (car (gimp-drawable-width inDrawable) ) )
(drHeight (car (gimp-drawable-height inDrawable) ) )
(dSize (if (< drWidth drHeight) drWidth drHeight ) )
(img (car (gimp-image-new dSize dSize RGB ) ) )
(baseTexture (car (gimp-layer-new img dSize dSize RGB-IMAGE "Base terrain" 100 NORMAL) ) )
(topTexture (car (gimp-layer-new img dSize dSize RGB-IMAGE "Top terrain" 100 NORMAL) ) )
(bottomTexture (car (gimp-layer-new img dSize dSize RGB-IMAGE "Bottom terrain" 100 NORMAL) ) )
(topSTexture (car (gimp-layer-new img dSize dSize RGB-IMAGE "Top sub terrain" 100 NORMAL) ) )
(bottomSTexture (car (gimp-layer-new img dSize dSize RGB-IMAGE "Bottom sub terrain" 100 NORMAL) ) )
(maskTexture)
)
(gimp-image-add-layer img baseTexture 0)
(plug-in-solid-noise 1 img baseTexture 1 0 (rand) 2 0.5 0.5)
(gimp-levels-stretch baseTexture)
; (plug-in-gauss 1 img baseTexture (* (/ dSize 100) 2) (* (/ dSize 100) 2) 1)
; Base terrain
(set! maskTexture (car (gimp-layer-copy baseTexture 1)))
(gimp-image-add-layer img maskTexture 0)
(gimp-posterize maskTexture 2)
(plug-in-gauss 1 img maskTexture (* (/ dSize 100) 20) (* (/ dSize 100) 20) 1)
; Mask for terrain
(gimp-image-add-layer img topTexture 0)
(gimp-image-add-layer img topSTexture 1)
(plug-in-solid-noise 1 img topTexture 1 0 (rand) 15 5 5)
(if inSimply (gimp-edit-copy topTexture))
(gimp-context-set-foreground '(255 255 255))
(gimp-drawable-fill topSTexture FOREGROUND-FILL)
(gimp-layer-set-opacity topTexture 50)
(set! topTexture (car (gimp-image-merge-down img topTexture CLIP-TO-IMAGE) ) )
(gimp-layer-add-mask topTexture (car (gimp-layer-create-mask maskTexture ADD-COPY-MASK) ) )
(gimp-layer-remove-mask topTexture MASK-APPLY)
; Land terrain
(gimp-image-add-layer img bottomTexture 1)
(gimp-image-add-layer img bottomSTexture 2)
(if (not inSimply) (plug-in-solid-noise 1 img bottomTexture 1 0 (rand) 15 5 5)
(begin
(gimp-floating-sel-attach (car (gimp-edit-paste bottomTexture TRUE) ) bottomTexture )
(gimp-drawable-transform-rotate-simple bottomTexture ROTATE-180 TRUE 0 0 TRUE)
)
)
(gimp-context-set-foreground '(0 0 0))
(gimp-drawable-fill bottomSTexture FOREGROUND-FILL)
(gimp-layer-set-opacity bottomTexture 50)
(set! bottomTexture (car (gimp-image-merge-down img bottomTexture CLIP-TO-IMAGE) ) )
(gimp-invert maskTexture)
(gimp-layer-add-mask bottomTexture (car (gimp-layer-create-mask maskTexture ADD-COPY-MASK) ) )
(gimp-layer-remove-mask bottomTexture MASK-APPLY)
; Sea terrain
(gimp-image-remove-layer img maskTexture)
(set! topTexture (car (gimp-image-merge-down img topTexture CLIP-TO-IMAGE) ) )
(set! topTexture (car (gimp-image-merge-down img topTexture CLIP-TO-IMAGE) ) )
(if (= inNormalize TRUE) (gimp-levels-stretch topTexture) )
(gimp-edit-copy topTexture)
(gimp-floating-sel-attach (car (gimp-edit-paste inDrawable TRUE) ) inDrawable )
(gimp-image-delete img)
(gimp-displays-flush)
))
(define (warstone-util-generate-gradient)
(let* (
(grad (car (gimp-gradient-new "Dummy") ) )
(leftColor (cons (rand 255) (cons (rand 255) (cons (rand 255) '()))))
(rightColor (cons (rand 255) (cons (rand 255) (cons (rand 255) '()))))
(colorVal 0)
(middleColor '())
)
(set! colorVal (- 255(/ (- 255 (/ (+ (car leftColor) (car rightColor)) 2)) 2)))
(set! middleColor (cons colorVal middleColor))
(set! colorVal (- 255(/ (- 255 (/ (+ (car (cdr leftColor)) (car (cdr leftColor))) 2)) 2)))
(set! middleColor (cons colorVal middleColor))
(set! colorVal (- 255(/ (- 255 (/ (+ (car (cdr (cdr leftColor))) (car (cdr (cdr leftColor)))) 2)) 2)))
(set! middleColor (cons colorVal middleColor))
(gimp-context-set-gradient grad)
(gimp-gradient-segment-range-split-uniform grad 0 0 2)
(gimp-gradient-segment-set-left-color grad 0 leftColor 100)
(gimp-gradient-segment-set-right-color grad 0 middleColor 100)
(gimp-gradient-segment-set-left-color grad 1 middleColor 100)
(gimp-gradient-segment-set-right-color grad 1 rightColor 100)
(gimp-context-get-gradient)
)
)
(define (warstone-clouds inImage inLayer)
(let*
(
(sizeH (car (gimp-drawable-height inLayer) ) )
(sizeW (car (gimp-drawable-width inLayer) ) )
(img (car (gimp-image-new sizeW sizeH RGB ) ) )
(baseL (car (gimp-layer-new img sizeW sizeH RGB-IMAGE "Top sub terrain" 100 NORMAL) ) )
(maskL 0)
(layers 15)
(i 0)
)
(gimp-image-add-layer img baseL 0)
(plug-in-solid-noise 1 img baseL 1 0 (rand) 2 1 1)
(while (< i layers)
(set! i (+ i 1) )
(set! maskL (car (gimp-layer-new img sizeW sizeH RGB-IMAGE "Top sub terrain" 50 OVERLAY-MODE) ) )
(gimp-image-add-layer img maskL 0)
(plug-in-solid-noise 1 img maskL 1 0 (rand) 2 i i)
(gimp-layer-add-mask baseL (car (gimp-layer-create-mask maskL ADD-COPY-MASK) ) )
(gimp-layer-remove-mask baseL MASK-APPLY)
(set! baseL maskL)
(gimp-drawable-transform-flip-simple baseL ORIENTATION-HORIZONTAL TRUE 1 TRUE)
)
(set! baseL (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE) ) )
(gimp-edit-copy baseL)
(gimp-floating-sel-attach (car (gimp-edit-paste inLayer TRUE) ) inLayer )
(gimp-image-delete img)
(gimp-displays-flush)
)
)
(define (warstone-util-sphere-emboss inImage inLayer)
(let*
(
(oldWidth (car (gimp-drawable-width inLayer) ) )
(workSel 0)
)
(plug-in-polar-coords 1 inImage inLayer 100 180 0 0 0)
(gimp-image-resize inImage (+ oldWidth 64) (car (gimp-drawable-height inLayer) ) 32 0)
(gimp-layer-resize inLayer (+ oldWidth 64) (car (gimp-drawable-height inLayer) ) 32 0)
(gimp-rect-select inImage 32 0 32 (car (gimp-drawable-height inLayer) ) CHANNEL-OP-REPLACE FALSE 0)
(gimp-edit-copy inLayer)
(set! workSel (car (gimp-edit-paste inLayer FALSE) ) )
(gimp-layer-set-offsets workSel (+ oldWidth 32) 0)
(gimp-floating-sel-attach workSel inLayer)
(gimp-rect-select inImage oldWidth 0 32 (car (gimp-drawable-height inLayer) ) CHANNEL-OP-REPLACE FALSE 0)
(gimp-edit-copy inLayer)
(set! workSel (car (gimp-edit-paste inLayer FALSE) ) )
(gimp-layer-set-offsets workSel 0 0)
(gimp-floating-sel-attach workSel inLayer)
(gimp-selection-none inImage)
(plug-in-emboss 1 inImage inLayer 30 45 5 FALSE)
(gimp-image-resize inImage oldWidth (car (gimp-drawable-height inLayer) ) -32 0)
(gimp-layer-resize inLayer oldWidth (car (gimp-drawable-height inLayer) ) -32 0)
(plug-in-polar-coords 1 inImage inLayer 100 180 0 0 1)
(gimp-displays-flush)
)
)
(define (warstone-planet inSize inTexture inPlanetize inGradient inGradientRandom)
(let*
(
(mapSize (* inSize 2) )
(endSize (+ inSize 16) )
(deltaSize (/ (- endSize mapSize) 2) )
(img (car (gimp-image-new mapSize mapSize RGB) ) )
(upperTexture (car (gimp-layer-new img mapSize mapSize RGB-IMAGE "Upper Texture" 100 NORMAL) ) )
(lowerTexture (car (gimp-layer-new img mapSize mapSize RGB-IMAGE "Lower Texture" 100 NORMAL) ) )
(maskTexture)
(surfGradient inGradient)
)
(gimp-context-push)
(if (= inGradientRandom 1) (set! surfGradient (car (warstone-util-generate-gradient))))
(if (= inPlanetize 0)
(begin
(gimp-image-add-layer img upperTexture 0)
(gimp-image-add-layer img lowerTexture 1)
(warstone-surface-texture img lowerTexture (= inTexture 1) FALSE)
(warstone-surface-texture img upperTexture (= inTexture 1) FALSE)
(plug-in-polar-coords 1 img upperTexture 100 180 0 1 0)
(gimp-drawable-transform-scale-default upperTexture 0 0 mapSize (- mapSize (/ mapSize 4) ) 1 TRANSFORM-RESIZE-ADJUST)
(plug-in-polar-coords 1 img lowerTexture 100 180 0 0 0)
(gimp-drawable-transform-scale-default lowerTexture 0 (/ mapSize 4) mapSize mapSize 1 TRANSFORM-RESIZE-ADJUST)
(set! maskTexture (car (gimp-layer-create-mask upperTexture ADD-WHITE-MASK) ) )
(gimp-layer-add-mask upperTexture maskTexture )
(gimp-context-set-foreground '(255 255 255) )
(gimp-context-set-background '(0 0 0) )
(gimp-edit-blend maskTexture FG-BG-RGB-MODE NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE 0 0 0 0 1 0 (/ mapSize 4) 0 (* (/ mapSize 4) 3) )
(set! upperTexture (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE) ) )
(gimp-layer-flatten upperTexture)
(gimp-layer-add-alpha upperTexture)
; Base tarrain ready
(plug-in-map-object 1 img upperTexture 1
0.5 0.5 2 ;viewpoint
0.5 0.5 0 ;position
1 0 0 ;1st axis
0 1 0 ;2nd axis
0 0 0 ;rotate angle
2 ;lighttype (2=none)
'(0 0 0) ;lightcolor
0 0 0 ;lightposition
0 0 0 ;lightdirection
0 0 0 0 0 ;material
TRUE FALSE FALSE TRUE 0.25
0.5 0.5 0.5 ;scale
0.8 -1 -1 -1 -1 -1 -1 -1 -1 ;cyl-and-box params
)
)
(begin
(gimp-image-add-layer img upperTexture 0)
(warstone-surface-texture img upperTexture (= inTexture 1) FALSE)
(gimp-layer-flatten upperTexture)
(gimp-layer-add-alpha upperTexture)
(plug-in-applylens 1 img upperTexture 2 FALSE FALSE TRUE)
(set! upperTexture (car (gimp-drawable-transform-scale-default upperTexture (/ (car (gimp-drawable-width upperTexture) ) 4) (/ (car (gimp-drawable-height upperTexture) ) 4) (* (/ (car (gimp-drawable-width upperTexture) ) 4) 3) (* (/ (car (gimp-drawable-height upperTexture) ) 4) 3) TRUE TRANSFORM-RESIZE-ADJUST ) ) )
(gimp-layer-resize-to-image-size upperTexture)
)
)
(gimp-levels-stretch upperTexture)
(set! lowerTexture (car (gimp-layer-copy upperTexture TRUE) ) )
(gimp-image-add-layer img lowerTexture 1)
; (set! maskTexture (car (gimp-layer-copy lowerTexture TRUE) ) )
(warstone-util-sphere-emboss img upperTexture)
(gimp-context-set-gradient surfGradient)
(plug-in-gradmap 1 img lowerTexture)
(gimp-layer-set-mode upperTexture SOFTLIGHT-MODE)
(set! upperTexture (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE) ) )
; (gimp-image-add-layer img maskTexture 1)
(if (= inGradientRandom 1) (gimp-gradient-delete surfGradient))
(gimp-image-resize img endSize endSize deltaSize deltaSize)
(gimp-layer-resize-to-image-size upperTexture)
(gimp-context-pop)
(gimp-display-new img)
(gimp-displays-flush)
)
)
(script-fu-register "warstone-surface-texture"
"Planet texture"
"Generate planet surface texture"
"Warstone"
"Copyright Warstone"
"Jul 2011"
"RGB* GRAY* INDEXED*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-TOGGLE "Simple" TRUE
SF-TOGGLE "Normalize" TRUE
)
(script-fu-register "warstone-clouds"
"Clouds texture"
"Generate clouds texture"
"Warstone"
"Copyright Warstone"
"Jul 2011"
"RGB* GRAY* INDEXED*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
(script-fu-register "warstone-planet"
"Planet"
"Create planet"
"Warstone"
"Copyright Warstone"
"Jul 2011"
""
SF-VALUE "Planet size" "128"
SF-OPTION "Texture generation method" '("Bitexturial" "Bitexturial-fast" "Semitexturial (NOT IMPLEMENTED)")
SF-OPTION "'Planetize' method" '("Projection" "Linse")
SF-GRADIENT "Surface gradient" "Caribbean Blues"
SF-TOGGLE "Generate gradient" TRUE
)
(script-fu-menu-register "warstone-planet" "<Image>/File/Create/Warstone")
(script-fu-menu-register "warstone-surface-texture" "<Image>/Filters/Warstone")
(script-fu-menu-register "warstone-clouds" "<Image>/Filters/Warstone") |
|
|
256X256 v1.03 (кликните здесь для просмотра)
|
|
1024X1024 v1.03 (кликните здесь для просмотра)
|
Дальнейшие планы:
- Переделать градиент на четкую плавную линию берега
- Сделать затенение от солнца (расположение солнца должно настраиваться)
- Сделать возможность генерации "огоньков" от поселений.
_________________ WARNING: By reading this post you accept that this post is genius.
Последний раз редактировалось: Варсик (13:05 29-07-2011), всего редактировалось 6 раз(а) |
|
|
|
|
|
|
|
|
Канал творчества: «GIMP В процессе осваивания» |
|
|
|